diff --git a/Makefile b/Makefile index d2f2522..427efbb 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ ENABLE_UART := 1 ENABLE_AIRCOPY := 0 ENABLE_FMRADIO := 1 ENABLE_NOAA := 0 -ENABLE_VOICE := 1 +ENABLE_VOICE := 0 ENABLE_ALARM := 0 ENABLE_BIG_FREQ := 0 ENABLE_SMALL_BOLD := 1 diff --git a/app/app.c b/app/app.c index db1a20e..0081c0a 100644 --- a/app/app.c +++ b/app/app.c @@ -611,10 +611,10 @@ static void FREQ_NextChannel(void) static void MR_NextChannel(void) { - const uint8_t PreviousCh = gNextMrChannel; const uint8_t Ch1 = gEeprom.SCANLIST_PRIORITY_CH1[gEeprom.SCAN_LIST_DEFAULT]; const uint8_t Ch2 = gEeprom.SCANLIST_PRIORITY_CH2[gEeprom.SCAN_LIST_DEFAULT]; const bool bEnabled = gEeprom.SCAN_LIST_ENABLED[gEeprom.SCAN_LIST_DEFAULT]; + uint8_t PreviousCh = gNextMrChannel; uint8_t Ch; if (bEnabled) @@ -623,10 +623,7 @@ static void MR_NextChannel(void) { gPreviousMrChannel = gNextMrChannel; if (RADIO_CheckValidChannel(Ch1, false, 0)) - { gNextMrChannel = Ch1; -// goto Skip; - } else gCurrentScanList = 1; } @@ -634,27 +631,30 @@ static void MR_NextChannel(void) if (gCurrentScanList == 1) { if (RADIO_CheckValidChannel(Ch2, false, 0)) - { gNextMrChannel = Ch2; -// goto Skip; - } else gCurrentScanList = 2; } if (gCurrentScanList == 2) + { gNextMrChannel = gPreviousMrChannel; - else - goto Skip; + Ch = RADIO_FindNextChannel(gNextMrChannel + gScanState, gScanState, true, gEeprom.SCAN_LIST_DEFAULT); + if (Ch == 0xFF) + return; + + gNextMrChannel = Ch; + } + } + else + { + Ch = RADIO_FindNextChannel(gNextMrChannel + gScanState, gScanState, true, gEeprom.SCAN_LIST_DEFAULT); + if (Ch == 0xFF) + return; + + gNextMrChannel = Ch; } - Ch = RADIO_FindNextChannel(gNextMrChannel + gScanState, gScanState, true, gEeprom.SCAN_LIST_DEFAULT); - if (Ch == 0xFF) - return; - - gNextMrChannel = Ch; - -Skip: if (PreviousCh != gNextMrChannel) { gEeprom.MrChannel[gEeprom.RX_CHANNEL] = gNextMrChannel; @@ -666,12 +666,11 @@ Skip: gUpdateDisplay = true; } - ScanPauseDelayIn_10ms = 20; - + ScanPauseDelayIn_10ms = scan_pause_delay_in_3_10ms; bScanKeepFrequency = false; if (bEnabled) - if (++gCurrentScanList >= 2) + if (++gCurrentScanList > 2) gCurrentScanList = 0; } diff --git a/firmware.bin b/firmware.bin index 648cd59..eaa556f 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index c62223c..9eb8eab 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/radio.c b/radio.c index ebb4ef0..134e32e 100644 --- a/radio.c +++ b/radio.c @@ -952,20 +952,18 @@ void RADIO_PrepareTX(void) VfoState_t State; #ifndef ENABLE_TX_WHEN_AM - // disable the TX when VFO/Channel is set to AM - // the radio does NOT do AM, the adverts are false if (gCurrentVfo->IsAM) - { + { // not allowed to TX if in AM mode State = VFO_STATE_TX_DISABLE; } else #endif if (!gSetting_TX_EN) - { + { // TX is disabled State = VFO_STATE_TX_DISABLE; } else - if (TX_FREQUENCY_Check(gCurrentVfo->pTX->Frequency) == 0 && gCurrentVfo->CHANNEL_SAVE <= FREQ_CHANNEL_LAST) + if (TX_FREQUENCY_Check(gCurrentVfo->pTX->Frequency) == 0 || gCurrentVfo->CHANNEL_SAVE <= FREQ_CHANNEL_LAST) { if (gCurrentVfo->BUSY_CHANNEL_LOCK && gCurrentFunction == FUNCTION_RECEIVE) State = VFO_STATE_BUSY;