0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

I broke power/battery save .. now fixed

This commit is contained in:
OneOfEleven
2023-09-18 21:18:00 +01:00
parent 787a705b45
commit 28ed7e7842
11 changed files with 40 additions and 42 deletions

View File

@ -86,11 +86,9 @@ void FUNCTION_Init(void)
void FUNCTION_Select(FUNCTION_Type_t Function)
{
FUNCTION_Type_t PreviousFunction;
bool bWasPowerSave;
FUNCTION_Type_t PreviousFunction = gCurrentFunction;
bool bWasPowerSave = (PreviousFunction == FUNCTION_POWER_SAVE);
PreviousFunction = gCurrentFunction;
bWasPowerSave = (PreviousFunction == FUNCTION_POWER_SAVE);
gCurrentFunction = Function;
if (bWasPowerSave)
@ -135,7 +133,8 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
case FUNCTION_POWER_SAVE:
gBatterySave_10ms = gEeprom.BATTERY_SAVE * 10;
gBatterySaveExpired = false;
gBatterySaveCountdownExpired = false;
gRxIdleMode = true;
@ -198,8 +197,8 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
break;
}
gBatterySaveCountdown_10ms = battery_save_count_10ms;
gBatterySaveCountdownExpired = false;
gBatterySaveCountdown_10ms = battery_save_count_10ms;
gSchedulePowerSave = false;
#if defined(ENABLE_FMRADIO)
gFM_RestoreCountdown = 0;