Skip to content

Commit 7b76ebe

Browse files
committed
main.cpp: only LCDlock will disable LCD menu
1 parent aa7e069 commit 7b76ebe

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

SmartEVSE-3/src/glcd.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,14 +1176,6 @@ void GLCDMenu(uint8_t Buttons) {
11761176
// Main Menu Navigation
11771177
BacklightTimer = BACKLIGHT; // delay before LCD backlight turns off.
11781178

1179-
// Disable buttons when access switch is configured and access is denied
1180-
if ((getItemValue(MENU_SWITCH) == 1 || getItemValue(MENU_SWITCH) == 2) && Access_bit == 0 && LCDNav == 0)
1181-
return;
1182-
1183-
if (getItemValue(MENU_RCMON) == 1 && (ErrorFlags & RCM_TRIPPED) && RCMFAULT == LOW) { // RCM was tripped, but RCM level is back to normal
1184-
ErrorFlags &= ~RCM_TRIPPED; // Clear RCM error bit, by pressing any button
1185-
}
1186-
11871179
if ((LCDNav == 0) && (Buttons == 0x5) && (ButtonRelease == 0)) { // Button 2 pressed ?
11881180
LCDNav = MENU_ENTER; // about to enter menu
11891181
ButtonTimer = millis();

SmartEVSE-3/src/main.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ uint8_t BacklightSet = 0;
253253
uint8_t LCDTimer = 0;
254254
uint8_t AccessTimer = 0;
255255
int8_t TempEVSE = 0; // Temperature EVSE in deg C (-50 to +125)
256-
uint8_t ButtonState = 0x0f; // Holds latest push Buttons state (LSB 3:0)
257-
uint8_t OldButtonState = 0x0f; // Holds previous push Buttons state (LSB 3:0)
256+
uint8_t ButtonState = 0x07; // Holds latest push Buttons state (LSB 2:0)
257+
uint8_t OldButtonState = 0x07; // Holds previous push Buttons state (LSB 2:0)
258258
uint8_t LCDNav = 0;
259259
uint8_t SubMenu = 0;
260260
uint32_t ScrollTimer = 0;
@@ -2287,8 +2287,13 @@ void Timer10ms(void * parameter) {
22872287
getButtonState();
22882288

22892289
// When one or more button(s) are pressed, we call GLCDMenu
2290-
if (((ButtonState != 0x07) || (ButtonState != OldButtonState)) && !LCDlock) GLCDMenu(ButtonState);
2291-
2290+
if (((ButtonState != 0x07) || (ButtonState != OldButtonState)) ) {
2291+
// RCM was tripped, but RCM level is back to normal
2292+
if (getItemValue(MENU_RCMON) == 1 && (ErrorFlags & RCM_TRIPPED) && RCMFAULT == LOW) {
2293+
ErrorFlags &= ~RCM_TRIPPED; // Clear RCM error bit
2294+
}
2295+
if (!LCDlock) GLCDMenu(ButtonState); // LCD is unlocked, enter menu
2296+
}
22922297
// Update/Show Helpmenu
22932298
if (LCDNav > MENU_ENTER && LCDNav < MENU_EXIT && (ScrollTimer + 5000 < millis() ) && (!SubMenu)) GLCDHelp();
22942299

0 commit comments

Comments
 (0)