Fix on StationList LW/MW/SW tuning

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-10-10 23:19:38 +02:00
parent 18f40a20c8
commit e7d893e4a3
+20 -8
View File
@@ -50,22 +50,34 @@ void Communication() {
ScreensaverTimerReopen(); ScreensaverTimerReopen();
} }
unsigned int tempfreq = (stlfreq.toInt()) / 1000; unsigned int tempfreq = (stlfreq.toInt()) / 1000;
if (tempfreq >= FREQ_LW_LOW_EDGE_MIN && tempfreq <= FREQ_LW_HIGH_EDGE_MAX && band != BAND_LW) { if (tempfreq >= FREQ_LW_LOW_EDGE_MIN && tempfreq <= FREQ_LW_HIGH_EDGE_MAX) {
band = BAND_LW;
frequency_LW = tempfreq; frequency_LW = tempfreq;
SelectBand(); if (band != BAND_LW) {
} else if (tempfreq >= FREQ_MW_LOW_EDGE_MIN_9K && tempfreq <= FREQ_MW_HIGH_EDGE_MAX_9K && band != BAND_MW) { band = BAND_LW;
band = BAND_MW; SelectBand();
} else {
radio.SetFreqAM(frequency_LW);
frequency_AM = frequency_LW;
}
} else if (tempfreq >= FREQ_MW_LOW_EDGE_MIN_9K && tempfreq <= FREQ_MW_HIGH_EDGE_MAX_9K) {
frequency_MW = tempfreq; frequency_MW = tempfreq;
SelectBand(); if (band != BAND_MW) {
band = BAND_MW;
SelectBand();
} else {
radio.SetFreqAM(frequency_MW);
frequency_AM = frequency_MW;
}
} else { } else {
frequency_SW = tempfreq;
if (band != BAND_SW) { if (band != BAND_SW) {
frequency_SW = tempfreq;
band = BAND_SW; band = BAND_SW;
SelectBand(); SelectBand();
} else {
radio.SetFreqAM(frequency_SW);
frequency_AM = frequency_SW;
} }
} }
radio.SetFreqAM(frequency_AM);
} }
radio.clearRDS(fullsearchrds); radio.clearRDS(fullsearchrds);
ShowFreq(0); ShowFreq(0);