From c2de9ca6e9b5d20a64320b350fa0ba0f93d0faf5 Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Tue, 2 Apr 2024 22:18:47 +0300 Subject: [PATCH] Fixed the bug that was closing the settings screen right after it opened --- Software/Gravity/Interactions.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Software/Gravity/Interactions.ino b/Software/Gravity/Interactions.ino index fcb4a82..6206f25 100644 --- a/Software/Gravity/Interactions.ino +++ b/Software/Gravity/Interactions.ino @@ -66,10 +66,10 @@ void checkInputs() { reboot(); } } else if (encReleasedTime - encPressedTime > 500 && !shiftBtnPushed) { // longer press is for navigating back. longer than 2s presses are no longer ignored (used do be < 2000) - if (displayScreen != 0) { - displayScreen = 0; - } else if (menuItemSelected == 1) { + if (menuItemSelected == 1) { menuItemSelected = 0; + } else if (displayScreen != 0) { + displayScreen = 0; } else if (insideTab == 1) { insideTab = 0; menuItem = 0; @@ -405,6 +405,7 @@ void checkInputs() { } } else if (shiftReleasedTime - shiftPressedTime > 2000 && encBtnPushed) { displayScreen = 2; + menuItemSelected = 1; //hack to prevent from going back when the encoder is released } saveState(); updateScreen();