From 8555c19c22a7b476471d4be5ca4975a28e4d3d08 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Tue, 19 Nov 2024 06:37:38 +0100 Subject: [PATCH] Improve Wake Up (disable key action except PTT) --- app/app.c | 19 +++++++++++++++++++ functions.c | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/app.c b/app/app.c index 32ec4e6..7735002 100644 --- a/app/app.c +++ b/app/app.c @@ -1825,6 +1825,25 @@ static void ALARM_Off(void) static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) { + #ifdef ENABLE_FEAT_F4HWN_SLEEP + if(gWakeUp) + { + if(!bKeyPressed || Key == KEY_PTT) + { + BACKLIGHT_TurnOn(); + + if(Key == KEY_SIDE1 || Key == KEY_SIDE2) + { + Key = KEY_INVALID; + } + } + else + { + return; + } + } + #endif + if (Key == KEY_EXIT && !BACKLIGHT_IsOn() && gEeprom.BACKLIGHT_TIME > 0) { // just turn the light on for now so the user can see what's what BACKLIGHT_TurnOn(); diff --git a/functions.c b/functions.c index 289226f..35709d7 100644 --- a/functions.c +++ b/functions.c @@ -121,7 +121,7 @@ void FUNCTION_PowerSave() { #ifdef ENABLE_FEAT_F4HWN_SLEEP if(gWakeUp) { - gPowerSave_10ms = gEeprom.BATTERY_SAVE * 250; // deep sleep now indexed on BatSav + gPowerSave_10ms = gEeprom.BATTERY_SAVE * 200; // deep sleep now indexed on BatSav } else {