Low battery popup

This commit is contained in:
Krzysiek Egzmont
2023-11-01 00:11:04 +01:00
parent 9f1e6ab91f
commit c2be853ef1
4 changed files with 56 additions and 25 deletions

View File

@@ -1906,8 +1906,18 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
}
}
if (gEeprom.KEY_LOCK && gCurrentFunction != FUNCTION_TRANSMIT && Key != KEY_PTT)
{ // keyboard is locked
bool lowBatPopup = gLowBattery && !gLowBatteryConfirmed && gScreenToDisplay == DISPLAY_MAIN;
if ((gEeprom.KEY_LOCK || lowBatPopup) && gCurrentFunction != FUNCTION_TRANSMIT && Key != KEY_PTT)
{ // keyboard is locked or low battery popup
// close low battery popup
if(Key == KEY_EXIT && bKeyPressed && lowBatPopup) {
gLowBatteryConfirmed = true;
gUpdateDisplay = true;
AUDIO_PlayBeep(BEEP_1KHZ_60MS_OPTIONAL);
return;
}
if (Key == KEY_F)
{ // function/key-lock key