diff --git a/main/displays/calibratedisplay.cpp b/main/displays/calibratedisplay.cpp index a537308..d007897 100644 --- a/main/displays/calibratedisplay.cpp +++ b/main/displays/calibratedisplay.cpp @@ -5,6 +5,7 @@ #include // local includes +#include "displays/menus/mainmenu.h" #include "displays/statusdisplay.h" #include "displays/menus/boardcomputerhardwaresettingsmenu.h" @@ -241,6 +242,12 @@ void CalibrateDisplay::back() case Status::Begin: if (m_bootup) espgui::switchScreen(); + else if (settings.lockscreen.keepLockedAfterReboot && settings.lockscreen.locked) + { + espgui::switchScreen(); + settings.lockscreen.locked = false; + saveSettings(); + } else espgui::switchScreen(); break; diff --git a/main/displays/lockscreen.cpp b/main/displays/lockscreen.cpp index 6a1551b..efe33c7 100644 --- a/main/displays/lockscreen.cpp +++ b/main/displays/lockscreen.cpp @@ -10,6 +10,7 @@ #include "texts.h" #include "buttons.h" #include "displays/menus/mainmenu.h" +#include "displays/calibratedisplay.h" void Lockscreen::start() { @@ -78,7 +79,10 @@ void Lockscreen::redraw() { if (m_numbers == settings.lockscreen.pin) { - espgui::switchScreen(); + if (!gas || !brems || *gas > 200.f || *brems > 200.f) + espgui::switchScreen(true); + else + espgui::switchScreen(); #ifdef LOCKSCREEN_PLUGIN #pragma message "Activating Lockscreen Plugin" #include LOCKSCREEN_PLUGIN @@ -135,10 +139,13 @@ void Lockscreen::stop() profileButtonDisabled = false; isLocked = false; - if (settings.lockscreen.keepLockedAfterReboot && settings.lockscreen.locked) + if (!(!gas || !brems || *gas > 200.f || *brems > 200.f)) { - settings.lockscreen.locked = false; - saveSettings(); + if (settings.lockscreen.keepLockedAfterReboot && settings.lockscreen.locked) + { + settings.lockscreen.locked = false; + saveSettings(); + } } } diff --git a/main/main.cpp b/main/main.cpp index e4f416c..36240dd 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -234,14 +234,14 @@ extern "C" void app_main() switchScreen(); #else - if (!gas || !brems || *gas > 200.f || *brems > 200.f) - espgui::switchScreen(true); + if (settings.lockscreen.keepLockedAfterReboot && settings.lockscreen.locked) + { + espgui::switchScreen(); + } else { - if (settings.lockscreen.keepLockedAfterReboot && settings.lockscreen.locked) - { - espgui::switchScreen(); - } + if (!gas || !brems || *gas > 200.f || *brems > 200.f) + espgui::switchScreen(true); else { espgui::switchScreen();