fix: reset blacklist for channel mode.

This commit is contained in:
Nunu 2023-12-28 16:54:20 +01:00
parent 74d71bc9ee
commit 18ead78efa

View File

@ -121,6 +121,8 @@ RegisterSpec registerSpecs[] = {
uint16_t statuslineUpdateTimer = 0; uint16_t statuslineUpdateTimer = 0;
static void RelaunchScan();
static uint8_t DBm2S(int dbm) { static uint8_t DBm2S(int dbm) {
uint8_t i = 0; uint8_t i = 0;
dbm *= -1; dbm *= -1;
@ -441,6 +443,13 @@ static void ResetBlacklist() {
memset(blacklistFreqs, 0, sizeof(blacklistFreqs)); memset(blacklistFreqs, 0, sizeof(blacklistFreqs));
blacklistFreqsIdx = 0; blacklistFreqsIdx = 0;
#endif #endif
if(appMode==CHANNEL_MODE){
scanChannelsCount = RADIO_ValidMemoryChannelsCount(true, settings.scanList);
LoadValidMemoryChannels();
AutoAdjustResolution();
}
RelaunchScan();
} }
static void RelaunchScan() { static void RelaunchScan() {
@ -553,7 +562,6 @@ static void UpdateScanStep(bool inc) {
return; return;
} }
settings.frequencyChangeStep = GetBW() >> 1; settings.frequencyChangeStep = GetBW() >> 1;
RelaunchScan();
ResetBlacklist(); ResetBlacklist();
redrawScreen = true; redrawScreen = true;
} }
@ -566,7 +574,6 @@ static void UpdateCurrentFreq(bool inc) {
} else { } else {
return; return;
} }
RelaunchScan();
ResetBlacklist(); ResetBlacklist();
redrawScreen = true; redrawScreen = true;
} }
@ -629,7 +636,6 @@ static void ToggleStepsCount() {
settings.stepsCount--; settings.stepsCount--;
} }
settings.frequencyChangeStep = GetBW() >> 1; settings.frequencyChangeStep = GetBW() >> 1;
RelaunchScan();
ResetBlacklist(); ResetBlacklist();
redrawScreen = true; redrawScreen = true;
} }
@ -1063,7 +1069,6 @@ static void OnKeyDownFreqInput(uint8_t key) {
currentFreq = tempFreq; currentFreq = tempFreq;
if (currentState == SPECTRUM) { if (currentState == SPECTRUM) {
ResetBlacklist(); ResetBlacklist();
RelaunchScan();
} else { } else {
SetF(currentFreq); SetF(currentFreq);
} }
@ -1528,7 +1533,6 @@ void APP_RunSpectrum() {
scanChannelsCount = RADIO_ValidMemoryChannelsCount(true, settings.scanList); scanChannelsCount = RADIO_ValidMemoryChannelsCount(true, settings.scanList);
LoadValidMemoryChannels(); LoadValidMemoryChannels();
RelaunchScan();
ResetBlacklist(); ResetBlacklist();
AutoAdjustResolution(); AutoAdjustResolution();
} }