Skip to content

Commit

Permalink
Improve exclude feature
Browse files Browse the repository at this point in the history
  • Loading branch information
armel committed Jul 25, 2024
1 parent 921fd98 commit a271d84
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ void SETTINGS_InitEEPROM(void)
att->__val = 0;
att->band = 0x7;
}
gMR_ChannelExclude[i] = false;
}

// 0F30..0F3F
Expand Down

0 comments on commit a271d84

Please sign in to comment.