Fixed FM resume from TX/RX.

This commit is contained in:
Dual Tachyon 2023-09-14 00:29:36 +01:00
parent 377b2ca396
commit b5fd2971df
2 changed files with 10 additions and 12 deletions

View File

@ -1140,7 +1140,7 @@ void APP_TimeSlice500ms(void)
gAskToDelete = false;
#if defined(ENABLE_FMRADIO)
if (gFmRadioMode && gCurrentFunction != FUNCTION_RECEIVE && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT) {
GUI_SelectNextDisplay(DISPLAY_FM);
GUI_SelectNextDisplay(DISPLAY_FM);
} else {
GUI_SelectNextDisplay(DISPLAY_MAIN);
}

View File

@ -73,9 +73,6 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
{
FUNCTION_Type_t PreviousFunction;
bool bWasPowerSave;
#if defined(ENABLE_FMRADIO)
uint16_t Countdown = 0;
#endif
PreviousFunction = gCurrentFunction;
bWasPowerSave = (PreviousFunction == FUNCTION_POWER_SAVE);
@ -97,15 +94,16 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
if (PreviousFunction == FUNCTION_TRANSMIT) {
gVFO_RSSI_Level[0] = 0;
gVFO_RSSI_Level[1] = 0;
} else if (PreviousFunction == FUNCTION_RECEIVE) {
} else if (PreviousFunction != FUNCTION_RECEIVE) {
break;
}
#if defined(ENABLE_FMRADIO)
if (gFmRadioMode) {
Countdown = 500;
}
if (gFmRadioMode) {
gFM_RestoreCountdown = 500;
}
#endif
if (gDTMF_CallState == DTMF_CALL_STATE_CALL_OUT || gDTMF_CallState == DTMF_CALL_STATE_RECEIVED) {
gDTMF_AUTO_RESET_TIME = 1 + (gEeprom.DTMF_AUTO_RESET_TIME * 2);
}
if (gDTMF_CallState == DTMF_CALL_STATE_CALL_OUT || gDTMF_CallState == DTMF_CALL_STATE_RECEIVED) {
gDTMF_AUTO_RESET_TIME = 1 + (gEeprom.DTMF_AUTO_RESET_TIME * 2);
}
return;
@ -175,7 +173,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
gBatterySaveCountdown = 1000;
gSchedulePowerSave = false;
#if defined(ENABLE_FMRADIO)
gFM_RestoreCountdown = Countdown;
gFM_RestoreCountdown = 0;
#endif
}