mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Check if scanlist is valid
This commit is contained in:
1 parent
dccdd37464
commit
5caff3af5a
3 files changed
+19
No files matched your search
@@ -467,11 +467,14 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
Value = (gInputBox[0] * 10) + gInputBox[1];
|
||||
|
||||
if (Value > 0 && Value <= MR_CHANNELS_LIST)
|
||||
{
|
||||
if(RADIO_CheckValidList(Value))
|
||||
{
|
||||
gEeprom.SCAN_LIST_DEFAULT = Value;
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
SETTINGS_WriteCurrentState();
|
||||
#endif
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -492,11 +495,14 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
return;
|
||||
}
|
||||
else if (Value > 0 && Value <= MR_CHANNELS_LIST)
|
||||
{
|
||||
if(RADIO_CheckValidList(Value))
|
||||
{
|
||||
gEeprom.SCAN_LIST_DEFAULT = Value;
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESUME_STATE
|
||||
SETTINGS_WriteCurrentState();
|
||||
#endif
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
+12
@@ -53,6 +53,18 @@ const char gModulationStr[MODULATION_UKNOWN][4] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
bool RADIO_CheckValidList(uint8_t scanList)
|
||||
{
|
||||
for (uint16_t i = 0; IS_MR_CHANNEL(i); i++) {
|
||||
const ChannelAttributes_t att = gMR_ChannelAttributes[i];
|
||||
if(att.scanlist == scanList && att.exclude == false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanList)
|
||||
{
|
||||
const ChannelAttributes_t att = gMR_ChannelAttributes[channel];
|
||||
|
||||
@@ -148,6 +148,7 @@ extern DCS_CodeType_t gCurrentCodeType;
|
||||
|
||||
extern VfoState_t VfoState[2];
|
||||
|
||||
bool RADIO_CheckValidList(uint8_t scanList);
|
||||
bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanList);
|
||||
uint16_t RADIO_FindNextChannel(uint16_t ChNum, int8_t Direction, bool bCheckScanList, uint8_t RadioNum);
|
||||
void RADIO_InitInfo(VFO_Info_t *pInfo, const uint16_t ChannelSave, const uint32_t Frequency);
|
||||
|
||||
Reference in new issue
Block a user