Added auto bandselector for StationList
This commit is contained in:
+23
-10
@@ -17,24 +17,37 @@ void Communication() {
|
|||||||
} else {
|
} else {
|
||||||
int symPos = packet.indexOf("freq=");
|
int symPos = packet.indexOf("freq=");
|
||||||
String stlfreq = packet.substring(symPos + 5, packetSize);
|
String stlfreq = packet.substring(symPos + 5, packetSize);
|
||||||
|
|
||||||
if ((stlfreq.toInt()) / 10000 > 6500 && (stlfreq.toInt()) / 10000 < 10800) {
|
if ((stlfreq.toInt()) / 10000 > 6500 && (stlfreq.toInt()) / 10000 < 10800) {
|
||||||
|
frequency = (stlfreq.toInt()) / 10000;
|
||||||
|
if (frequency >= FREQ_FM_OIRT_START && frequency <= FREQ_FM_OIRT_END && band != BAND_OIRT) {
|
||||||
|
band = BAND_OIRT;
|
||||||
|
SelectBand();
|
||||||
|
} else {
|
||||||
if (band != BAND_FM) {
|
if (band != BAND_FM) {
|
||||||
band = BAND_FM;
|
band = BAND_FM;
|
||||||
SelectBand();
|
SelectBand();
|
||||||
}
|
}
|
||||||
frequency = (stlfreq.toInt()) / 10000;
|
}
|
||||||
radio.SetFreq(frequency);
|
radio.SetFreq(frequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
// To Do: AM
|
if ((stlfreq.toInt()) / 1000 > 144 && (stlfreq.toInt()) / 1000 < 27000) {
|
||||||
// if ((stlfreq.toInt()) / 1000 > 144 && (stlfreq.toInt()) / 1000 < 27000) {
|
frequency_AM = (stlfreq.toInt()) / 1000;
|
||||||
// if (band != 5) {
|
if (frequency_AM >= FREQ_LW_LOW_EDGE_MIN && frequency_AM <= FREQ_LW_HIGH_EDGE_MAX && band != BAND_LW) {
|
||||||
// band = 5;
|
band = BAND_LW;
|
||||||
// SelectBand();
|
SelectBand();
|
||||||
// }
|
} else if (frequency_AM >= FREQ_MW_LOW_EDGE_MIN_9K && frequency_AM <= FREQ_MW_HIGH_EDGE_MAX_9K && band != BAND_MW) {
|
||||||
// frequency5 = (stlfreq.toInt()) / 1000;
|
band = BAND_MW;
|
||||||
// radio.SetFreqAM(frequency5);
|
SelectBand();
|
||||||
// }
|
} else {
|
||||||
|
if (band != BAND_SW) {
|
||||||
|
band = BAND_SW;
|
||||||
|
SelectBand();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
radio.SetFreqAM(frequency_AM);
|
||||||
|
}
|
||||||
radio.clearRDS(fullsearchrds);
|
radio.clearRDS(fullsearchrds);
|
||||||
ShowFreq(0);
|
ShowFreq(0);
|
||||||
store = true;
|
store = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user