mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Fix priority channels ONLY if SCAN_LIST_ENABLED[0] is active
This commit is contained in:
1 parent
992be7f0d1
commit
732acbcea1
1 file changed
+11
-13
+11
-13
@@ -58,31 +58,29 @@ bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanL
|
||||
// return true if the channel appears valid
|
||||
if (!IS_MR_CHANNEL(channel))
|
||||
return false;
|
||||
|
||||
const ChannelAttributes_t att = gMR_ChannelAttributes[channel];
|
||||
|
||||
if (checkScanList && att.exclude == true)
|
||||
return false;
|
||||
|
||||
if (att.band > BAND7_470MHz)
|
||||
return false;
|
||||
|
||||
//if (!checkScanList || scanList > 4)
|
||||
if (!checkScanList || scanList > MR_CHANNELS_LIST)
|
||||
return true;
|
||||
|
||||
if ((scanList == 0) || (scanList != att.scanlist)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//return true;
|
||||
|
||||
// I don't understand what this code is for...
|
||||
|
||||
const uint16_t PriorityCh1 = gEeprom.SCANLIST_PRIORITY_CH[0];
|
||||
const uint16_t PriorityCh2 = gEeprom.SCANLIST_PRIORITY_CH[1];
|
||||
|
||||
return PriorityCh1 != channel && PriorityCh2 != channel;
|
||||
// Exclude priority channels ONLY if SCAN_LIST_ENABLED[0] is active
|
||||
// Otherwise, treat them as normal channels in the list
|
||||
if (gEeprom.SCAN_LIST_ENABLED[0])
|
||||
{
|
||||
const uint16_t PriorityCh1 = gEeprom.SCANLIST_PRIORITY_CH[0];
|
||||
const uint16_t PriorityCh2 = gEeprom.SCANLIST_PRIORITY_CH[1];
|
||||
if (PriorityCh1 == channel || PriorityCh2 == channel)
|
||||
return false; // Excluded because it's a priority channel and they are enabled
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint16_t RADIO_FindNextChannel(uint16_t Channel, int8_t Direction, bool bCheckScanList, uint8_t VFO)
|
||||
|
||||
Reference in new issue
Block a user