more fm radio trimming

This commit is contained in:
Nunu 2024-01-26 11:47:27 +01:00
parent b27adf80ed
commit 72073b6ac2
7 changed files with 7 additions and 72 deletions

View File

@ -102,42 +102,12 @@ void ACTION_Monitor(void)
RADIO_SetupRegisters(true);
#ifdef ENABLE_FMRADIO
if (gFmRadioMode) {
FM_Start();
gRequestDisplayScreen = DISPLAY_FM;
}
else
#endif
gRequestDisplayScreen = gScreenToDisplay;
}
void ACTION_Scan(bool bRestart)
{
(void)bRestart;
#ifdef ENABLE_FMRADIO
if (gFmRadioMode)
{
if (gCurrentFunction != FUNCTION_RECEIVE &&
gCurrentFunction != FUNCTION_MONITOR &&
gCurrentFunction != FUNCTION_TRANSMIT)
{
GUI_SelectNextDisplay(DISPLAY_FM);
gMonitor = false;
if (gFM_ScanState != FM_SCAN_OFF)
{
FM_Start();
#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
#endif
}
}
return;
}
#endif
if (!SCANNER_IsScanning())
{ // not scanning

View File

@ -61,13 +61,9 @@ void GENERIC_Key_F(bool bKeyPressed, bool bKeyHeld)
}
else // released
{
#ifdef ENABLE_FMRADIO
if ((gFmRadioMode || gScreenToDisplay != DISPLAY_MAIN) && gScreenToDisplay != DISPLAY_FM)
return;
#else
if (gScreenToDisplay != DISPLAY_MAIN)
return;
#endif
if (gScreenToDisplay != DISPLAY_MAIN)
return;
gWasFKeyPressed = !gWasFKeyPressed; // toggle F function
@ -90,14 +86,6 @@ void GENERIC_Key_F(bool bKeyPressed, bool bKeyHeld)
return;
}
#ifdef ENABLE_FMRADIO
if (gFM_ScanState == FM_SCAN_OFF) // not scanning
{
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
return;
}
#endif
gBeepToPlay = BEEP_440HZ_500MS;
gPttWasReleased = true;

View File

@ -505,9 +505,6 @@ void BOARD_Init(void)
BACKLIGHT_InitHardware();
BOARD_ADC_Init();
ST7565_Init(true);
#ifdef ENABLE_FMRADIO
BK1080_Init(0, false);
#endif
CRC_Init();
}

6
misc.c
View File

@ -171,9 +171,6 @@ bool gFlagResetVfos;
bool gRequestSaveVFO;
uint8_t gRequestSaveChannel;
bool gRequestSaveSettings;
#ifdef ENABLE_FMRADIO
bool gRequestSaveFM;
#endif
bool gFlagPrepareTX;
bool gFlagAcceptSetting;
@ -182,9 +179,6 @@ bool gFlagRefreshSetting;
bool gFlagSaveVfo;
bool gFlagSaveSettings;
bool gFlagSaveChannel;
#ifdef ENABLE_FMRADIO
bool gFlagSaveFM;
#endif
bool g_CDCSS_Lost;
uint8_t gCDCSSCodeType;
bool g_CTCSS_Lost;

9
misc.h
View File

@ -280,9 +280,6 @@ extern bool gFlagResetVfos;
extern bool gRequestSaveVFO;
extern uint8_t gRequestSaveChannel;
extern bool gRequestSaveSettings;
#ifdef ENABLE_FMRADIO
extern bool gRequestSaveFM;
#endif
extern uint8_t gKeypadLocked;
extern bool gFlagPrepareTX;
@ -292,9 +289,6 @@ extern bool gFlagRefreshSetting; // refresh menu display
extern bool gFlagSaveVfo;
extern bool gFlagSaveSettings;
extern bool gFlagSaveChannel;
#ifdef ENABLE_FMRADIO
extern bool gFlagSaveFM;
#endif
extern bool g_CDCSS_Lost;
extern uint8_t gCDCSSCodeType;
extern bool g_CTCSS_Lost;
@ -335,9 +329,6 @@ extern uint8_t gFSKWriteIndex;
extern volatile bool gNextTimeslice;
extern bool gUpdateDisplay;
extern bool gF_LOCK;
#ifdef ENABLE_FMRADIO
extern uint8_t gFM_ChannelPosition;
#endif
extern uint8_t gShowChPrefix;
extern volatile uint8_t gFoundCDCSSCountdown_10ms;
extern volatile uint8_t gFoundCTCSSCountdown_10ms;

View File

@ -99,10 +99,10 @@ void SystickHandler(void)
DECREMENT_AND_TRIGGER(gCountdownToPlayNextVoice_10ms, gFlagPlayQueuedVoice);
#endif
#ifdef ENABLE_FMRADIO
if (gFM_ScanState != FM_SCAN_OFF && gCurrentFunction != FUNCTION_MONITOR)
if (gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_RECEIVE)
DECREMENT_AND_TRIGGER(gFmPlayCountdown_10ms, gScheduleFM);
#ifdef ENABLE_FMRADIO //gFM_ScanState is never different than FM_SCAN_OFF
// if (gFM_ScanState != FM_SCAN_OFF && gCurrentFunction != FUNCTION_MONITOR)
// if (gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_RECEIVE)
// DECREMENT_AND_TRIGGER(gFmPlayStandardCountdown_10ms, gScheduleFM);
#endif
#ifdef ENABLE_VOX

View File

@ -154,12 +154,7 @@ typedef struct {
uint8_t field8_0xb;
#ifdef ENABLE_FMRADIO
uint16_t FM_SelectedFrequency;
uint8_t FM_SelectedChannel;
bool FM_IsMrMode;
uint16_t FM_FrequencyPlaying;
uint16_t FM_LowerLimit;
uint16_t FM_UpperLimit;
#endif
uint8_t SQUELCH_LEVEL;