FIX #26: vfo state (TX DISABLE label) update issue when FM radio disabled in Makefile

This commit is contained in:
Krzysiek Egzmont 2023-10-12 00:44:52 +02:00
parent 06c2ddf543
commit 7e6a78ab6c
7 changed files with 25 additions and 28 deletions

View File

@ -1895,24 +1895,24 @@ void APP_TimeSlice500ms(void)
if (gCurrentFunction != FUNCTION_POWER_SAVE && gCurrentFunction != FUNCTION_TRANSMIT)
updateRSSI(gEeprom.RX_VFO);
#ifdef ENABLE_FMRADIO
if (!gPttIsPressed && gFM_ResumeCountdown_500ms > 0)
if (!gPttIsPressed && gVFOStateResumeCountdown_500ms > 0)
{
if (--gVFOStateResumeCountdown_500ms == 0)
{
if (--gFM_ResumeCountdown_500ms == 0)
{
RADIO_SetVfoState(VFO_STATE_NORMAL);
if (gCurrentFunction != FUNCTION_RECEIVE &&
gCurrentFunction != FUNCTION_TRANSMIT &&
gCurrentFunction != FUNCTION_MONITOR &&
gFmRadioMode)
{ // switch back to FM radio mode
FM_Start();
GUI_SelectNextDisplay(DISPLAY_FM);
}
RADIO_SetVfoState(VFO_STATE_NORMAL);
#ifdef ENABLE_FMRADIO
if (gCurrentFunction != FUNCTION_RECEIVE &&
gCurrentFunction != FUNCTION_TRANSMIT &&
gCurrentFunction != FUNCTION_MONITOR &&
gFmRadioMode)
{ // switch back to FM radio mode
FM_Start();
GUI_SelectNextDisplay(DISPLAY_FM);
}
#endif
}
#endif
}
if (gLowBattery)
{

View File

@ -45,7 +45,6 @@ bool gFM_AutoScan;
uint8_t gFM_ChannelPosition;
bool gFM_FoundFrequency;
bool gFM_AutoScan;
uint8_t gFM_ResumeCountdown_500ms;
uint16_t gFM_RestoreCountdown_10ms;
bool FM_CheckValidChannel(uint8_t Channel)

View File

@ -39,7 +39,6 @@ extern uint8_t gFM_ChannelPosition;
extern uint16_t gFM_FrequencyDeviation;
extern bool gFM_FoundFrequency;
extern bool gFM_AutoScan;
extern uint8_t gFM_ResumeCountdown_500ms;
extern uint16_t gFM_RestoreCountdown_10ms;
bool FM_CheckValidChannel(uint8_t Channel);

5
misc.c
View File

@ -19,12 +19,13 @@
#include "misc.h"
#include "settings.h"
const uint8_t fm_resume_countdown_500ms = 2500 / 500; // 2.5 seconds
const uint8_t fm_radio_countdown_500ms = 2000 / 500; // 2 seconds
const uint16_t fm_play_countdown_scan_10ms = 100 / 10; // 100ms
const uint16_t fm_play_countdown_noscan_10ms = 1200 / 10; // 1.2 seconds
const uint16_t fm_restore_countdown_10ms = 5000 / 10; // 5 seconds
const uint8_t vfo_state_resume_countdown_500ms = 2500 / 500; // 2.5 seconds
const uint8_t menu_timeout_500ms = 20000 / 500; // 20 seconds
const uint16_t menu_timeout_long_500ms = 120000 / 500; // 2 minutes
@ -141,6 +142,8 @@ volatile bool gTxTimeoutReached;
volatile uint16_t gTailNoteEliminationCountdown_10ms;
volatile uint8_t gVFOStateResumeCountdown_500ms;
#ifdef ENABLE_NOAA
volatile uint16_t gNOAA_Countdown_10ms;
#endif

4
misc.h
View File

@ -93,12 +93,13 @@ enum scan_next_chan_t {
};
typedef enum scan_next_chan_t scan_next_chan_t;
extern const uint8_t fm_resume_countdown_500ms;
extern const uint8_t fm_radio_countdown_500ms;
extern const uint16_t fm_play_countdown_scan_10ms;
extern const uint16_t fm_play_countdown_noscan_10ms;
extern const uint16_t fm_restore_countdown_10ms;
extern const uint8_t vfo_state_resume_countdown_500ms;
extern const uint8_t menu_timeout_500ms;
extern const uint16_t menu_timeout_long_500ms;
@ -319,6 +320,7 @@ extern volatile bool gNextTimeslice40ms;
extern volatile bool gScheduleNOAA;
#endif
extern volatile bool gFlagTailNoteEliminationComplete;
extern volatile uint8_t gVFOStateResumeCountdown_500ms;
#ifdef ENABLE_FMRADIO
extern volatile bool gScheduleFM;
#endif

View File

@ -898,10 +898,7 @@ void RADIO_SetVfoState(VfoState_t State)
{
VfoState[0] = VFO_STATE_NORMAL;
VfoState[1] = VFO_STATE_NORMAL;
#ifdef ENABLE_FMRADIO
gFM_ResumeCountdown_500ms = 0;
#endif
gVFOStateResumeCountdown_500ms = 0;
}
else
{
@ -916,9 +913,7 @@ void RADIO_SetVfoState(VfoState_t State)
VfoState[vfo] = State;
}
#ifdef ENABLE_FMRADIO
gFM_ResumeCountdown_500ms = fm_resume_countdown_500ms;
#endif
gVFOStateResumeCountdown_500ms = vfo_state_resume_countdown_500ms;
}
gUpdateDisplay = true;

View File

@ -323,7 +323,6 @@ void UI_DisplayMain(void)
uint8_t *p_line0 = gFrameBuffer[line + 0];
uint8_t *p_line1 = gFrameBuffer[line + 1];
unsigned int mode = 0;
unsigned int state;
if (single_vfo)
{ // we're in single VFO mode - screen is dedicated to just one VFO
@ -472,7 +471,7 @@ void UI_DisplayMain(void)
// ************
state = VfoState[vfo_num];
unsigned int state = VfoState[vfo_num];
#ifdef ENABLE_ALARM
if (gCurrentFunction == FUNCTION_TRANSMIT && gAlarmState == ALARM_STATE_ALARM)