FIX #26: vfo state (TX DISABLE label) update issue when FM radio disabled in Makefile
This commit is contained in:
30
app/app.c
30
app/app.c
@@ -1895,24 +1895,24 @@ void APP_TimeSlice500ms(void)
|
|||||||
if (gCurrentFunction != FUNCTION_POWER_SAVE && gCurrentFunction != FUNCTION_TRANSMIT)
|
if (gCurrentFunction != FUNCTION_POWER_SAVE && gCurrentFunction != FUNCTION_TRANSMIT)
|
||||||
updateRSSI(gEeprom.RX_VFO);
|
updateRSSI(gEeprom.RX_VFO);
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
if (!gPttIsPressed && gVFOStateResumeCountdown_500ms > 0)
|
||||||
if (!gPttIsPressed && gFM_ResumeCountdown_500ms > 0)
|
{
|
||||||
|
if (--gVFOStateResumeCountdown_500ms == 0)
|
||||||
{
|
{
|
||||||
if (--gFM_ResumeCountdown_500ms == 0)
|
RADIO_SetVfoState(VFO_STATE_NORMAL);
|
||||||
{
|
#ifdef ENABLE_FMRADIO
|
||||||
RADIO_SetVfoState(VFO_STATE_NORMAL);
|
if (gCurrentFunction != FUNCTION_RECEIVE &&
|
||||||
|
gCurrentFunction != FUNCTION_TRANSMIT &&
|
||||||
if (gCurrentFunction != FUNCTION_RECEIVE &&
|
gCurrentFunction != FUNCTION_MONITOR &&
|
||||||
gCurrentFunction != FUNCTION_TRANSMIT &&
|
gFmRadioMode)
|
||||||
gCurrentFunction != FUNCTION_MONITOR &&
|
{ // switch back to FM radio mode
|
||||||
gFmRadioMode)
|
FM_Start();
|
||||||
{ // switch back to FM radio mode
|
GUI_SelectNextDisplay(DISPLAY_FM);
|
||||||
FM_Start();
|
|
||||||
GUI_SelectNextDisplay(DISPLAY_FM);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
|
|
||||||
if (gLowBattery)
|
if (gLowBattery)
|
||||||
{
|
{
|
||||||
|
1
app/fm.c
1
app/fm.c
@@ -45,7 +45,6 @@ bool gFM_AutoScan;
|
|||||||
uint8_t gFM_ChannelPosition;
|
uint8_t gFM_ChannelPosition;
|
||||||
bool gFM_FoundFrequency;
|
bool gFM_FoundFrequency;
|
||||||
bool gFM_AutoScan;
|
bool gFM_AutoScan;
|
||||||
uint8_t gFM_ResumeCountdown_500ms;
|
|
||||||
uint16_t gFM_RestoreCountdown_10ms;
|
uint16_t gFM_RestoreCountdown_10ms;
|
||||||
|
|
||||||
bool FM_CheckValidChannel(uint8_t Channel)
|
bool FM_CheckValidChannel(uint8_t Channel)
|
||||||
|
1
app/fm.h
1
app/fm.h
@@ -39,7 +39,6 @@ extern uint8_t gFM_ChannelPosition;
|
|||||||
extern uint16_t gFM_FrequencyDeviation;
|
extern uint16_t gFM_FrequencyDeviation;
|
||||||
extern bool gFM_FoundFrequency;
|
extern bool gFM_FoundFrequency;
|
||||||
extern bool gFM_AutoScan;
|
extern bool gFM_AutoScan;
|
||||||
extern uint8_t gFM_ResumeCountdown_500ms;
|
|
||||||
extern uint16_t gFM_RestoreCountdown_10ms;
|
extern uint16_t gFM_RestoreCountdown_10ms;
|
||||||
|
|
||||||
bool FM_CheckValidChannel(uint8_t Channel);
|
bool FM_CheckValidChannel(uint8_t Channel);
|
||||||
|
5
misc.c
5
misc.c
@@ -19,12 +19,13 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "settings.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 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_scan_10ms = 100 / 10; // 100ms
|
||||||
const uint16_t fm_play_countdown_noscan_10ms = 1200 / 10; // 1.2 seconds
|
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 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 uint8_t menu_timeout_500ms = 20000 / 500; // 20 seconds
|
||||||
const uint16_t menu_timeout_long_500ms = 120000 / 500; // 2 minutes
|
const uint16_t menu_timeout_long_500ms = 120000 / 500; // 2 minutes
|
||||||
|
|
||||||
@@ -141,6 +142,8 @@ volatile bool gTxTimeoutReached;
|
|||||||
|
|
||||||
volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
volatile uint16_t gTailNoteEliminationCountdown_10ms;
|
||||||
|
|
||||||
|
volatile uint8_t gVFOStateResumeCountdown_500ms;
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
volatile uint16_t gNOAA_Countdown_10ms;
|
volatile uint16_t gNOAA_Countdown_10ms;
|
||||||
#endif
|
#endif
|
||||||
|
4
misc.h
4
misc.h
@@ -93,12 +93,13 @@ enum scan_next_chan_t {
|
|||||||
};
|
};
|
||||||
typedef enum scan_next_chan_t 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 uint8_t fm_radio_countdown_500ms;
|
||||||
extern const uint16_t fm_play_countdown_scan_10ms;
|
extern const uint16_t fm_play_countdown_scan_10ms;
|
||||||
extern const uint16_t fm_play_countdown_noscan_10ms;
|
extern const uint16_t fm_play_countdown_noscan_10ms;
|
||||||
extern const uint16_t fm_restore_countdown_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 uint8_t menu_timeout_500ms;
|
||||||
extern const uint16_t menu_timeout_long_500ms;
|
extern const uint16_t menu_timeout_long_500ms;
|
||||||
|
|
||||||
@@ -319,6 +320,7 @@ extern volatile bool gNextTimeslice40ms;
|
|||||||
extern volatile bool gScheduleNOAA;
|
extern volatile bool gScheduleNOAA;
|
||||||
#endif
|
#endif
|
||||||
extern volatile bool gFlagTailNoteEliminationComplete;
|
extern volatile bool gFlagTailNoteEliminationComplete;
|
||||||
|
extern volatile uint8_t gVFOStateResumeCountdown_500ms;
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
extern volatile bool gScheduleFM;
|
extern volatile bool gScheduleFM;
|
||||||
#endif
|
#endif
|
||||||
|
9
radio.c
9
radio.c
@@ -898,10 +898,7 @@ void RADIO_SetVfoState(VfoState_t State)
|
|||||||
{
|
{
|
||||||
VfoState[0] = VFO_STATE_NORMAL;
|
VfoState[0] = VFO_STATE_NORMAL;
|
||||||
VfoState[1] = VFO_STATE_NORMAL;
|
VfoState[1] = VFO_STATE_NORMAL;
|
||||||
|
gVFOStateResumeCountdown_500ms = 0;
|
||||||
#ifdef ENABLE_FMRADIO
|
|
||||||
gFM_ResumeCountdown_500ms = 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -916,9 +913,7 @@ void RADIO_SetVfoState(VfoState_t State)
|
|||||||
VfoState[vfo] = State;
|
VfoState[vfo] = State;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
gVFOStateResumeCountdown_500ms = vfo_state_resume_countdown_500ms;
|
||||||
gFM_ResumeCountdown_500ms = fm_resume_countdown_500ms;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gUpdateDisplay = true;
|
gUpdateDisplay = true;
|
||||||
|
@@ -323,7 +323,6 @@ void UI_DisplayMain(void)
|
|||||||
uint8_t *p_line0 = gFrameBuffer[line + 0];
|
uint8_t *p_line0 = gFrameBuffer[line + 0];
|
||||||
uint8_t *p_line1 = gFrameBuffer[line + 1];
|
uint8_t *p_line1 = gFrameBuffer[line + 1];
|
||||||
unsigned int mode = 0;
|
unsigned int mode = 0;
|
||||||
unsigned int state;
|
|
||||||
|
|
||||||
if (single_vfo)
|
if (single_vfo)
|
||||||
{ // we're in single VFO mode - screen is dedicated to just one 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
|
#ifdef ENABLE_ALARM
|
||||||
if (gCurrentFunction == FUNCTION_TRANSMIT && gAlarmState == ALARM_STATE_ALARM)
|
if (gCurrentFunction == FUNCTION_TRANSMIT && gAlarmState == ALARM_STATE_ALARM)
|
||||||
|
Reference in New Issue
Block a user