Bugfix in Stationlist tuning

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-10-09 23:23:00 +02:00
parent 014a4614bb
commit fa7146f52a
3 changed files with 13 additions and 8 deletions

View File

@@ -66,6 +66,7 @@ bool errorAold;
bool errorBold;
bool errorCold;
bool errorDold;
bool externaltune;
bool fullsearchrds;
bool hasafold;
bool haseonold;
@@ -1645,7 +1646,7 @@ void SelectBand() {
if (band == BAND_MW) freqold = frequency_MW;
if (band == BAND_SW) freqold = frequency_SW;
LimitAMFrequency();
CheckBandForbiddenAM();
if (!externaltune) CheckBandForbiddenAM();
radio.SetFreqAM(frequency_AM);
radio.setAMAttenuation(amrfagc);
radio.setAMCoChannel(amcodect, amcodectcount);
@@ -1677,7 +1678,7 @@ void SelectBand() {
BWset = BWsetFM;
radio.clearRDS(fullsearchrds);
freqold = frequency_AM;
CheckBandForbiddenFM();
if (!externaltune) CheckBandForbiddenFM();
doBW();
if (!screenmute) BuildDisplay();
}

View File

@@ -15,22 +15,24 @@ void Communication() {
if (strcmp(packetBuffer, "from=StationList;freq=?;bandwidth=?") == 0) {
ShowFreq(0);
} else {
externaltune = true;
int symPos = packet.indexOf("freq=");
String stlfreq = packet.substring(symPos + 5, packetSize);
if (afscreen) BuildAdvancedRDS();
if ((stlfreq.toInt()) / 10000 > 6500 && (stlfreq.toInt()) / 10000 < 10800) {
unsigned int tempfreq = (stlfreq.toInt()) / 10000;
if (tempfreq >= FREQ_FM_OIRT_START && tempfreq <= FREQ_FM_OIRT_END) {
if (band != BAND_OIRT) {
band = BAND_OIRT;
frequency_OIRT = tempfreq;
BuildDisplay();
SelectBand();
}
} else {
if (band != BAND_FM) {
band = BAND_FM;
frequency = tempfreq;
BuildDisplay();
SelectBand();
}
}
if (band == BAND_OIRT) {
@@ -47,18 +49,18 @@ void Communication() {
BuildDisplay();
ScreensaverTimerReopen();
}
frequency_AM = (stlfreq.toInt()) / 1000;
unsigned int tempfreq = (stlfreq.toInt()) / 1000;
if (frequency_AM >= FREQ_LW_LOW_EDGE_MIN && frequency_AM <= FREQ_LW_HIGH_EDGE_MAX && band != BAND_LW) {
band = BAND_LW;
frequency_LW = frequency_AM;
frequency_LW = tempfreq;
SelectBand();
} else if (frequency_AM >= FREQ_MW_LOW_EDGE_MIN_9K && frequency_AM <= FREQ_MW_HIGH_EDGE_MAX_9K && band != BAND_MW) {
band = BAND_MW;
frequency_MW = frequency_AM;
frequency_MW = tempfreq;
SelectBand();
} else {
if (band != BAND_SW) {
frequency_SW = frequency_AM;
frequency_SW = tempfreq;
band = BAND_SW;
SelectBand();
}
@@ -68,6 +70,7 @@ void Communication() {
radio.clearRDS(fullsearchrds);
ShowFreq(0);
store = true;
externaltune = false;
}
}
}

View File

@@ -15,6 +15,7 @@ extern bool afscreen;
extern bool aftest;
extern bool BWreset;
extern bool direction;
extern bool externaltune;
extern bool fullsearchrds;
extern bool menu;
extern bool RDSSPYTCP;