Improve exclude feature

This commit is contained in:
Armel FAUVEAU
2024-07-25 04:56:50 +02:00
parent 921fd983d6
commit a271d847c3
5 changed files with 8 additions and 6 deletions

View File

@@ -627,15 +627,11 @@ static void MAIN_Key_MENU(bool bKeyPressed, bool bKeyHeld)
#ifdef ENABLE_FEAT_F4HWN
// Exclude work with list 1, 2, 3 or all list
if(gScanStateDir != SCAN_OFF && (gEeprom.SCAN_LIST_DEFAULT > 0 && gEeprom.SCAN_LIST_DEFAULT < 5))
if(gScanStateDir != SCAN_OFF)
{
if(FUNCTION_IsRx())
{
gTxVfo->SCANLIST1_PARTICIPATION = 0;
gTxVfo->SCANLIST2_PARTICIPATION = 0;
gTxVfo->SCANLIST3_PARTICIPATION = 0;
SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true, true, false);
gMR_ChannelExclude[gTxVfo->CHANNEL_SAVE] = true;
gVfoConfigureMode = VFO_CONFIGURE;
gFlagResetVfos = true;

1
misc.c
View File

@@ -140,6 +140,7 @@ uint16_t gEEPROM_1F8A;
uint16_t gEEPROM_1F8C;
ChannelAttributes_t gMR_ChannelAttributes[FREQ_CHANNEL_LAST + 1];
bool gMR_ChannelExclude[FREQ_CHANNEL_LAST + 1];
volatile uint16_t gBatterySaveCountdown_10ms = battery_save_count_10ms;

1
misc.h
View File

@@ -205,6 +205,7 @@ typedef union {
} ChannelAttributes_t;
extern ChannelAttributes_t gMR_ChannelAttributes[207];
extern bool gMR_ChannelExclude[207];
extern volatile uint16_t gBatterySaveCountdown_10ms;

View File

@@ -62,6 +62,9 @@ bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanL
const ChannelAttributes_t att = gMR_ChannelAttributes[channel];
if (gMR_ChannelExclude[channel] == true)
return false;
if (att.band > BAND7_470MHz)
return false;

View File

@@ -300,6 +300,7 @@ void SETTINGS_InitEEPROM(void)
att->__val = 0;
att->band = 0x7;
}
gMR_ChannelExclude[i] = false;
}
// 0F30..0F3F