Made UI fsm skip low battery check when TX is enabled to avoid spurious triggers of low battery alert caused by the high current absorption from RF PA

replace/2cf5098dc98640cc2474b558b3504c3f97133938
Silvano Seva 2021-02-24 21:00:30 +01:00
rodzic 6b24895ef3
commit 056c53b35d
2 zmienionych plików z 22 dodań i 20 usunięć

Wyświetl plik

@ -251,11 +251,6 @@ static void dev_task(void *arg)
(void) arg;
OS_ERR os_err;
// Initialise battery voltage, to avoid filter settling transient
OSMutexPend(&state_mutex, 0u, OS_OPT_PEND_BLOCKING, 0u, &os_err);
state.v_bat = platform_getVbat();
OSMutexPost(&state_mutex, OS_OPT_POST_NONE, &os_err);
while(1)
{
// Lock mutex and update internal state

Wyświetl plik

@ -703,12 +703,17 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
platform_terminate();
return;
}
// Check if battery has enough charge to operate
float charge = battery_getCharge(state.v_bat);
if (!state.emergency && charge <= 0)
// Check if battery has enough charge to operate.
// Check is skipped if there is an ongoing transmission, since the voltage
// drop caused by the RF PA power absorption causes spurious triggers of
// the low battery alert.
bool txOngoing = platform_getPttStatus();
if ((!state.emergency) && (!txOngoing) && (state.charge <= 0))
{
state.ui_screen = LOW_BAT;
if(event.type == EVENT_KBD && event.payload) {
if(event.type == EVENT_KBD && event.payload)
{
state.ui_screen = MAIN_VFO;
state.emergency = true;
}
@ -726,7 +731,9 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
macro_menu = true;
_ui_fsm_menuMacro(msg, sync_rtx);
return;
} else {
}
else
{
macro_menu = false;
}
switch(state.ui_screen)