diff --git a/app/action.c b/app/action.c index a545898..bfc3295 100644 --- a/app/action.c +++ b/app/action.c @@ -346,9 +346,8 @@ void ACTION_FM(void) static void ACTION_Scan_FM(bool bRestart) { - if (FUNCTION_IsRx()) { + if (FUNCTION_IsRx()) return; - } GUI_SelectNextDisplay(DISPLAY_FM); @@ -363,21 +362,21 @@ static void ACTION_Scan_FM(bool bRestart) return; } - uint16_t Frequency; + uint16_t freq; if (bRestart) { - gFM_AutoScan = true; + gFM_AutoScan = true; gFM_ChannelPosition = 0; FM_EraseChannels(); - Frequency = gEeprom.FM_LowerLimit; + freq = gEeprom.FM_LowerLimit; } else { - gFM_AutoScan = false; + gFM_AutoScan = false; gFM_ChannelPosition = 0; - Frequency = gEeprom.FM_FrequencyPlaying; + freq = gEeprom.FM_FrequencyPlaying; } - BK1080_GetFrequencyDeviation(Frequency); - FM_Tune(Frequency, 1, bRestart); + BK1080_GetFrequencyDeviation(freq); + FM_Tune(freq, 1, bRestart); #ifdef ENABLE_VOICE gAnotherVoiceID = VOICE_ID_SCANNING_BEGIN; diff --git a/app/fm.c b/app/fm.c index 5e9086f..934495a 100644 --- a/app/fm.c +++ b/app/fm.c @@ -67,14 +67,10 @@ bool FM_CheckValidChannel(uint8_t Channel) uint8_t FM_FindNextChannel(uint8_t Channel, uint8_t Direction) { - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(gFM_Channels); i++) - { + for (unsigned i = 0; i < ARRAY_SIZE(gFM_Channels); i++) { if (Channel == 0xFF) Channel = ARRAY_SIZE(gFM_Channels) - 1; - else - if (Channel >= ARRAY_SIZE(gFM_Channels)) + else if (Channel >= ARRAY_SIZE(gFM_Channels)) Channel = 0; if (FM_CheckValidChannel(Channel)) return Channel; @@ -88,11 +84,9 @@ int FM_ConfigureChannelState(void) { gEeprom.FM_FrequencyPlaying = gEeprom.FM_SelectedFrequency; - if (gEeprom.FM_IsMrMode) - { + if (gEeprom.FM_IsMrMode) { const uint8_t Channel = FM_FindNextChannel(gEeprom.FM_SelectedChannel, FM_CHANNEL_UP); - if (Channel == 0xFF) - { + if (Channel == 0xFF) { gEeprom.FM_IsMrMode = false; return -1; } @@ -110,7 +104,6 @@ void FM_TurnOff(void) gFM_RestoreCountdown_10ms = 0; AUDIO_AudioPathOff(); - gEnableSpeaker = false; BK1080_Init(0, false); @@ -120,11 +113,10 @@ void FM_TurnOff(void) void FM_EraseChannels(void) { - unsigned int i; uint8_t Template[8]; - memset(Template, 0xFF, sizeof(Template)); - for (i = 0; i < 5; i++) + + for (unsigned i = 0; i < 5; i++) EEPROM_WriteBuffer(0x0E40 + (i * 8), Template); memset(gFM_Channels, 0xFF, sizeof(gFM_Channels)); @@ -144,13 +136,11 @@ void FM_Tune(uint16_t Frequency, int8_t Step, bool bFlag) gAskToDelete = false; gEeprom.FM_FrequencyPlaying = Frequency; - if (!bFlag) - { + if (!bFlag) { Frequency += Step; if (Frequency < gEeprom.FM_LowerLimit) Frequency = gEeprom.FM_UpperLimit; - else - if (Frequency > gEeprom.FM_UpperLimit) + else if (Frequency > gEeprom.FM_UpperLimit) Frequency = gEeprom.FM_LowerLimit; gEeprom.FM_FrequencyPlaying = Frequency; @@ -165,8 +155,7 @@ void FM_PlayAndUpdate(void) { gFM_ScanState = FM_SCAN_OFF; - if (gFM_AutoScan) - { + if (gFM_AutoScan) { gEeprom.FM_IsMrMode = true; gEeprom.FM_SelectedChannel = 0; } @@ -193,7 +182,7 @@ int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit) // This is supposed to be a signed value, but above function is unsigned const uint16_t Deviation = BK1080_REG_07_GET_FREQD(Test2); - if (BK1080_REG_07_GET_SNR(Test2) <= 2){ + if (BK1080_REG_07_GET_SNR(Test2) <= 2) { goto Bail; } @@ -219,7 +208,6 @@ int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit) if (Frequency >= LowerLimit && (BK1080_BaseFrequency - Frequency) == 1) { if ((BK1080_FrequencyDeviation & 0x800) == 0 || (BK1080_FrequencyDeviation > 4075)) goto Bail; - } ret = 0; @@ -236,93 +224,93 @@ static void Key_DIGITS(KEY_Code_t Key, uint8_t state) enum { STATE_FREQ_MODE, STATE_MR_MODE, STATE_SAVE }; if (state == BUTTON_EVENT_SHORT && !gWasFKeyPressed) { - uint8_t State; + uint8_t State; - if (gAskToDelete) { + if (gAskToDelete) { + gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + return; + } + + if (gAskToSave) { + State = STATE_SAVE; + } + else { + if (gFM_ScanState != FM_SCAN_OFF) { gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; return; } - if (gAskToSave) { - State = STATE_SAVE; + State = gEeprom.FM_IsMrMode ? STATE_MR_MODE : STATE_FREQ_MODE; + } + + INPUTBOX_Append(Key); + + gRequestDisplayScreen = DISPLAY_FM; + + if (State == STATE_FREQ_MODE) { + if (gInputBoxIndex == 1) { + if (gInputBox[0] > 1) { + gInputBox[1] = gInputBox[0]; + gInputBox[0] = 0; + gInputBoxIndex = 2; + } } - else { - if (gFM_ScanState != FM_SCAN_OFF) { - gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + else if (gInputBoxIndex > 3) { + uint32_t Frequency; + + gInputBoxIndex = 0; + Frequency = StrToUL(INPUTBOX_GetAscii()); + + if (Frequency < gEeprom.FM_LowerLimit || gEeprom.FM_UpperLimit < Frequency) { + gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + gRequestDisplayScreen = DISPLAY_FM; return; } - State = gEeprom.FM_IsMrMode ? STATE_MR_MODE : STATE_FREQ_MODE; + gEeprom.FM_SelectedFrequency = (uint16_t)Frequency; +#ifdef ENABLE_VOICE + gAnotherVoiceID = (VOICE_ID_t)Key; +#endif + gEeprom.FM_FrequencyPlaying = gEeprom.FM_SelectedFrequency; + BK1080_SetFrequency(gEeprom.FM_FrequencyPlaying); + gRequestSaveFM = true; + return; } + } + else if (gInputBoxIndex == 2) { + uint8_t Channel; - INPUTBOX_Append(Key); + gInputBoxIndex = 0; + Channel = ((gInputBox[0] * 10) + gInputBox[1]) - 1; - gRequestDisplayScreen = DISPLAY_FM; - - if (State == STATE_FREQ_MODE) { - if (gInputBoxIndex == 1) { - if (gInputBox[0] > 1) { - gInputBox[1] = gInputBox[0]; - gInputBox[0] = 0; - gInputBoxIndex = 2; - } - } - else if (gInputBoxIndex > 3) { - uint32_t Frequency; - - gInputBoxIndex = 0; - Frequency = StrToUL(INPUTBOX_GetAscii()); - - if (Frequency < gEeprom.FM_LowerLimit || gEeprom.FM_UpperLimit < Frequency) { - gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; - gRequestDisplayScreen = DISPLAY_FM; - return; - } - - gEeprom.FM_SelectedFrequency = (uint16_t)Frequency; + if (State == STATE_MR_MODE) { + if (FM_CheckValidChannel(Channel)) { #ifdef ENABLE_VOICE gAnotherVoiceID = (VOICE_ID_t)Key; #endif - gEeprom.FM_FrequencyPlaying = gEeprom.FM_SelectedFrequency; + gEeprom.FM_SelectedChannel = Channel; + gEeprom.FM_FrequencyPlaying = gFM_Channels[Channel]; BK1080_SetFrequency(gEeprom.FM_FrequencyPlaying); gRequestSaveFM = true; return; } } - else if (gInputBoxIndex == 2) { - uint8_t Channel; - + else if (Channel < 20) { +#ifdef ENABLE_VOICE + gAnotherVoiceID = (VOICE_ID_t)Key; +#endif + gRequestDisplayScreen = DISPLAY_FM; gInputBoxIndex = 0; - Channel = ((gInputBox[0] * 10) + gInputBox[1]) - 1; - - if (State == STATE_MR_MODE) { - if (FM_CheckValidChannel(Channel)) { -#ifdef ENABLE_VOICE - gAnotherVoiceID = (VOICE_ID_t)Key; -#endif - gEeprom.FM_SelectedChannel = Channel; - gEeprom.FM_FrequencyPlaying = gFM_Channels[Channel]; - BK1080_SetFrequency(gEeprom.FM_FrequencyPlaying); - gRequestSaveFM = true; - return; - } - } - else if (Channel < 20) { -#ifdef ENABLE_VOICE - gAnotherVoiceID = (VOICE_ID_t)Key; -#endif - gRequestDisplayScreen = DISPLAY_FM; - gInputBoxIndex = 0; - gFM_ChannelPosition = Channel; - return; - } - - gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + gFM_ChannelPosition = Channel; return; } + gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; + return; + } + #ifdef ENABLE_VOICE - gAnotherVoiceID = (VOICE_ID_t)Key; + gAnotherVoiceID = (VOICE_ID_t)Key; #endif } else @@ -331,8 +319,7 @@ static void Key_DIGITS(KEY_Code_t Key, uint8_t state) static void Key_FUNC(KEY_Code_t Key, uint8_t state) { - if (state == BUTTON_EVENT_SHORT || state == BUTTON_EVENT_HELD) - { + if (state == BUTTON_EVENT_SHORT || state == BUTTON_EVENT_HELD) { bool autoScan = gWasFKeyPressed || (state == BUTTON_EVENT_HELD); gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL; @@ -348,8 +335,7 @@ static void Key_FUNC(KEY_Code_t Key, uint8_t state) case KEY_3: gEeprom.FM_IsMrMode = !gEeprom.FM_IsMrMode; - if (!FM_ConfigureChannelState()) - { + if (!FM_ConfigureChannelState()) { BK1080_SetFrequency(gEeprom.FM_FrequencyPlaying); gRequestSaveFM = true; } @@ -375,12 +361,9 @@ static void Key_EXIT(uint8_t state) gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL; - if (gFM_ScanState == FM_SCAN_OFF) - { - if (gInputBoxIndex == 0) - { - if (!gAskToSave && !gAskToDelete) - { + if (gFM_ScanState == FM_SCAN_OFF) { + if (gInputBoxIndex == 0) { + if (!gAskToSave && !gAskToDelete) { ACTION_FM(); return; } @@ -388,38 +371,32 @@ static void Key_EXIT(uint8_t state) gAskToSave = false; gAskToDelete = false; } - else - { + else { gInputBox[--gInputBoxIndex] = 10; - if (gInputBoxIndex) - { - if (gInputBoxIndex != 1) - { + if (gInputBoxIndex) { + if (gInputBoxIndex != 1) { gRequestDisplayScreen = DISPLAY_FM; return; } - if (gInputBox[0] != 0) - { + if (gInputBox[0] != 0) { gRequestDisplayScreen = DISPLAY_FM; return; } } - gInputBoxIndex = 0; } - #ifdef ENABLE_VOICE - gAnotherVoiceID = VOICE_ID_CANCEL; - #endif +#ifdef ENABLE_VOICE + gAnotherVoiceID = VOICE_ID_CANCEL; +#endif } - else - { + else { FM_PlayAndUpdate(); - #ifdef ENABLE_VOICE - gAnotherVoiceID = VOICE_ID_SCANNING_STOP; - #endif +#ifdef ENABLE_VOICE + gAnotherVoiceID = VOICE_ID_SCANNING_STOP; +#endif } gRequestDisplayScreen = DISPLAY_FM; @@ -434,21 +411,16 @@ static void Key_MENU(uint8_t state) gRequestDisplayScreen = DISPLAY_FM; gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL; - if (gFM_ScanState == FM_SCAN_OFF) - { - if (!gEeprom.FM_IsMrMode) - { - if (gAskToSave) - { + if (gFM_ScanState == FM_SCAN_OFF) { + if (!gEeprom.FM_IsMrMode) { + if (gAskToSave) { gFM_Channels[gFM_ChannelPosition] = gEeprom.FM_FrequencyPlaying; gRequestSaveFM = true; } gAskToSave = !gAskToSave; } - else - { - if (gAskToDelete) - { + else { + if (gAskToDelete) { gFM_Channels[gEeprom.FM_SelectedChannel] = 0xFFFF; FM_ConfigureChannelState(); @@ -456,21 +428,17 @@ static void Key_MENU(uint8_t state) gRequestSaveFM = true; } - gAskToDelete = !gAskToDelete; } } - else - { - if (gFM_AutoScan || !gFM_FoundFrequency) - { + else { + if (gFM_AutoScan || !gFM_FoundFrequency) { gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; gInputBoxIndex = 0; return; } - if (gAskToSave) - { + if (gAskToSave) { gFM_Channels[gFM_ChannelPosition] = gEeprom.FM_FrequencyPlaying; gRequestSaveFM = true; } @@ -521,8 +489,7 @@ static void Key_UP_DOWN(uint8_t state, int8_t Step) if (Frequency < gEeprom.FM_LowerLimit) Frequency = gEeprom.FM_UpperLimit; - else - if (Frequency > gEeprom.FM_UpperLimit) + else if (Frequency > gEeprom.FM_UpperLimit) Frequency = gEeprom.FM_LowerLimit; gEeprom.FM_FrequencyPlaying = Frequency; @@ -541,18 +508,8 @@ void FM_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) { uint8_t state = bKeyPressed + 2 * bKeyHeld; - switch (Key) - { - case KEY_0: - case KEY_1: - case KEY_2: - case KEY_3: - case KEY_4: - case KEY_5: - case KEY_6: - case KEY_7: - case KEY_8: - case KEY_9: + switch (Key) { + case KEY_0...KEY_9: Key_DIGITS(Key, state); break; case KEY_STAR: @@ -585,10 +542,8 @@ void FM_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) void FM_Play(void) { - if (!FM_CheckFrequencyLock(gEeprom.FM_FrequencyPlaying, gEeprom.FM_LowerLimit)) - { - if (!gFM_AutoScan) - { + if (!FM_CheckFrequencyLock(gEeprom.FM_FrequencyPlaying, gEeprom.FM_LowerLimit)) { + if (!gFM_AutoScan) { gFmPlayCountdown_10ms = 0; gFM_FoundFrequency = true; @@ -605,8 +560,7 @@ void FM_Play(void) if (gFM_ChannelPosition < 20) gFM_Channels[gFM_ChannelPosition++] = gEeprom.FM_FrequencyPlaying; - if (gFM_ChannelPosition >= 20) - { + if (gFM_ChannelPosition >= 20) { FM_PlayAndUpdate(); GUI_SelectNextDisplay(DISPLAY_FM); return; diff --git a/app/fm.h b/app/fm.h index ca96c04..51bac66 100644 --- a/app/fm.h +++ b/app/fm.h @@ -41,6 +41,7 @@ extern bool gFM_FoundFrequency; extern uint16_t gFM_RestoreCountdown_10ms; bool FM_CheckValidChannel(uint8_t Channel); +// returns first valid channel starting at Channel uint8_t FM_FindNextChannel(uint8_t Channel, uint8_t Direction); int FM_ConfigureChannelState(void); void FM_TurnOff(void); diff --git a/driver/bk1080.c b/driver/bk1080.c index 48b8157..c395612 100644 --- a/driver/bk1080.c +++ b/driver/bk1080.c @@ -43,12 +43,10 @@ void BK1080_Init(uint16_t Frequency, bool bDoScan) { unsigned int i; - if (bDoScan) - { + if (bDoScan) { GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BK1080); - if (!gIsInitBK1080) - { + if (!gIsInitBK1080) { for (i = 0; i < ARRAY_SIZE(BK1080_RegisterTable); i++) BK1080_WriteRegister(i, BK1080_RegisterTable[i]); @@ -61,20 +59,14 @@ void BK1080_Init(uint16_t Frequency, bool bDoScan) gIsInitBK1080 = true; } - else - { + else { BK1080_WriteRegister(BK1080_REG_02_POWER_CONFIGURATION, 0x0201); } BK1080_WriteRegister(BK1080_REG_05_SYSTEM_CONFIGURATION2, 0x0A5F); - BK1080_WriteRegister(BK1080_REG_03_CHANNEL, Frequency - 760); - - SYSTEM_DelayMs(10); - - BK1080_WriteRegister(BK1080_REG_03_CHANNEL, (Frequency - 760) | 0x8000); + BK1080_SetFrequency(Frequency); } - else - { + else { BK1080_WriteRegister(BK1080_REG_02_POWER_CONFIGURATION, 0x0241); GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BK1080); } @@ -108,11 +100,12 @@ void BK1080_Mute(bool Mute) BK1080_WriteRegister(BK1080_REG_02_POWER_CONFIGURATION, Mute ? 0x4201 : 0x0201); } -void BK1080_SetFrequency(uint16_t Frequency) +void BK1080_SetFrequency(uint16_t frequency) { - BK1080_WriteRegister(BK1080_REG_03_CHANNEL, Frequency - 760); + uint16_t channel = frequency - 760; + BK1080_WriteRegister(BK1080_REG_03_CHANNEL, channel); SYSTEM_DelayMs(10); - BK1080_WriteRegister(BK1080_REG_03_CHANNEL, (Frequency - 760) | 0x8000); + BK1080_WriteRegister(BK1080_REG_03_CHANNEL, channel | 0x8000); } void BK1080_GetFrequencyDeviation(uint16_t Frequency) diff --git a/driver/bk1080.h b/driver/bk1080.h index ed1f9c1..61fddc6 100644 --- a/driver/bk1080.h +++ b/driver/bk1080.h @@ -28,7 +28,7 @@ void BK1080_Init(uint16_t Frequency, bool bDoScan); uint16_t BK1080_ReadRegister(BK1080_Register_t Register); void BK1080_WriteRegister(BK1080_Register_t Register, uint16_t Value); void BK1080_Mute(bool Mute); -void BK1080_SetFrequency(uint16_t Frequency); +void BK1080_SetFrequency(uint16_t frequency); void BK1080_GetFrequencyDeviation(uint16_t Frequency); #endif diff --git a/driver/i2c.c b/driver/i2c.c index 957dbb5..6200364 100644 --- a/driver/i2c.c +++ b/driver/i2c.c @@ -137,18 +137,13 @@ int I2C_ReadBuffer(void *pBuffer, uint8_t Size) uint8_t *pData = (uint8_t *)pBuffer; uint8_t i; - if (Size == 1) { - *pData = I2C_Read(true); - return 1; - } - for (i = 0; i < Size - 1; i++) { SYSTICK_DelayUs(1); pData[i] = I2C_Read(false); } SYSTICK_DelayUs(1); - pData[i++] = I2C_Read(true); + pData[i] = I2C_Read(true); return Size; } diff --git a/settings.c b/settings.c index 183f3cc..4b99282 100644 --- a/settings.c +++ b/settings.c @@ -87,22 +87,19 @@ void SETTINGS_InitEEPROM(void) { // 0E88..0E8F struct { - uint16_t SelectedFrequency; - uint8_t SelectedChannel; - uint8_t IsMrMode; - uint8_t Padding[8]; - } __attribute__((packed)) FM; + uint16_t selFreq; + uint8_t selChn; + uint8_t isMrMode; + } __attribute__((packed)) fmCfg; + EEPROM_ReadBuffer(0x0E88, &fmCfg, 4); - EEPROM_ReadBuffer(0x0E88, &FM, 8); gEeprom.FM_LowerLimit = 760; gEeprom.FM_UpperLimit = 1080; - if (FM.SelectedFrequency < gEeprom.FM_LowerLimit || FM.SelectedFrequency > gEeprom.FM_UpperLimit) - gEeprom.FM_SelectedFrequency = 960; - else - gEeprom.FM_SelectedFrequency = FM.SelectedFrequency; - - gEeprom.FM_SelectedChannel = FM.SelectedChannel; - gEeprom.FM_IsMrMode = (FM.IsMrMode < 2) ? FM.IsMrMode : false; + gEeprom.FM_SelectedFrequency = + (fmCfg.selFreq >= gEeprom.FM_LowerLimit && fmCfg.selFreq <= gEeprom.FM_UpperLimit) ? fmCfg.selFreq : 960; + + gEeprom.FM_SelectedChannel = fmCfg.selChn; + gEeprom.FM_IsMrMode = (fmCfg.isMrMode < 2) ? fmCfg.isMrMode : false; } // 0E40..0E67 diff --git a/settings.h b/settings.h index 4b27f60..1f04ca3 100644 --- a/settings.h +++ b/settings.h @@ -128,9 +128,9 @@ typedef struct { uint8_t ScreenChannel[2]; // current channels set in the radio (memory or frequency channels) uint8_t FreqChannel[2]; // last frequency channels used uint8_t MrChannel[2]; // last memory channels used - #ifdef ENABLE_NOAA - uint8_t NoaaChannel[2]; - #endif +#ifdef ENABLE_NOAA + uint8_t NoaaChannel[2]; +#endif // The actual VFO index (0-upper/1-lower) that is now used for RX, // It is being alternated by dual watch, and flipped by crossband @@ -143,23 +143,23 @@ typedef struct { uint8_t field7_0xa; 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 +#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; uint8_t TX_TIMEOUT_TIMER; bool KEY_LOCK; bool VOX_SWITCH; uint8_t VOX_LEVEL; - #ifdef ENABLE_VOICE - VOICE_Prompt_t VOICE_PROMPT; - #endif +#ifdef ENABLE_VOICE + VOICE_Prompt_t VOICE_PROMPT; +#endif bool BEEP_CONTROL; uint8_t CHANNEL_DISPLAY_MODE; bool TAIL_TONE_ELIMINATION; @@ -181,9 +181,9 @@ typedef struct { uint8_t field38_0x33; bool AUTO_KEYPAD_LOCK; - #if defined(ENABLE_ALARM) || defined(ENABLE_TX1750) - ALARM_Mode_t ALARM_MODE; - #endif +#if defined(ENABLE_ALARM) || defined(ENABLE_TX1750) + ALARM_Mode_t ALARM_MODE; +#endif POWER_OnDisplayMode_t POWER_ON_DISPLAY_MODE; ROGER_Mode_t ROGER; uint8_t REPEATER_TAIL_TONE_ELIMINATION; @@ -225,9 +225,9 @@ typedef struct { bool PERMIT_REMOTE_KILL; #endif int16_t BK4819_XTAL_FREQ_LOW; - #ifdef ENABLE_NOAA - bool NOAA_AUTO_SCAN; - #endif +#ifdef ENABLE_NOAA + bool NOAA_AUTO_SCAN; +#endif uint8_t VOLUME_GAIN; uint8_t DAC_GAIN;