Fix for crash in Exclude mode FMDX scan
This commit is contained in:
+10
-6
@@ -2640,7 +2640,7 @@ bool IsStationEmpty() {
|
|||||||
bool IsFrequencyUsed(unsigned int freq) {
|
bool IsFrequencyUsed(unsigned int freq) {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
for (byte x = scanstart; x <= scanstop; x++) {
|
for (byte x = scanstart; x <= scanstop; x++) {
|
||||||
if (presets[x].band == BAND_FM && presets[x].frequency == freq) {
|
if ((presets[x].band == BAND_FM || presets[x].band == BAND_OIRT) && presets[x].frequency == freq) {
|
||||||
result = true;
|
result = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -3745,6 +3745,11 @@ void TuneUp() {
|
|||||||
radio.SetFreq(frequency);
|
radio.SetFreq(frequency);
|
||||||
} else if (band == BAND_OIRT) {
|
} else if (band == BAND_OIRT) {
|
||||||
frequency_OIRT += temp;
|
frequency_OIRT += temp;
|
||||||
|
if (scandxmode) {
|
||||||
|
while (IsFrequencyUsed(frequency_OIRT)) {
|
||||||
|
frequency += temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (frequency_OIRT > HighEdgeOIRTSet) {
|
if (frequency_OIRT > HighEdgeOIRTSet) {
|
||||||
frequency_OIRT = LowEdgeOIRTSet;
|
frequency_OIRT = LowEdgeOIRTSet;
|
||||||
if (edgebeep) EdgeBeeper();
|
if (edgebeep) EdgeBeeper();
|
||||||
@@ -4404,18 +4409,17 @@ void startFMDXScan() {
|
|||||||
scanmodeold = tunemode;
|
scanmodeold = tunemode;
|
||||||
if (scanmem) {
|
if (scanmem) {
|
||||||
tunemode = TUNE_MEM;
|
tunemode = TUNE_MEM;
|
||||||
if (band != BAND_FM) {
|
if (band != presets[memorypos].band) {
|
||||||
band = BAND_FM;
|
band = presets[memorypos].band;
|
||||||
SelectBand();
|
SelectBand();
|
||||||
}
|
}
|
||||||
if (menu) endMenu();
|
if (menu) endMenu();
|
||||||
DoMemoryPosTune();
|
DoMemoryPosTune();
|
||||||
} else {
|
} else {
|
||||||
tunemode = TUNE_MAN;
|
tunemode = TUNE_MAN;
|
||||||
if (band != BAND_FM) {
|
if (band != presets[memorypos].band) {
|
||||||
band = BAND_FM;
|
band = presets[memorypos].band;
|
||||||
SelectBand();
|
SelectBand();
|
||||||
endMenu();
|
|
||||||
}
|
}
|
||||||
if (menu) endMenu();
|
if (menu) endMenu();
|
||||||
TuneUp();
|
TuneUp();
|
||||||
|
|||||||
Reference in New Issue
Block a user