Fixed a problem when using FM scanner with cancel on correct PI

This commit is contained in:
Sjef Verhoeven PE5PVB
2024-06-04 19:04:53 +02:00
parent f0477180b1
commit c3e3e235a0
+8 -3
View File
@@ -76,6 +76,7 @@ bool hasCTold;
bool haseonold; bool haseonold;
bool hasrtplusold; bool hasrtplusold;
bool hastmcold; bool hastmcold;
bool initdxscan;
bool leave; bool leave;
bool LowLevelInit; bool LowLevelInit;
bool memorystore; bool memorystore;
@@ -846,6 +847,7 @@ void loop() {
if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n");
} }
scantimer = millis(); scantimer = millis();
initdxscan = false;
} }
if (millis() >= flashingtimer + 500) { if (millis() >= flashingtimer + 500) {
@@ -861,9 +863,11 @@ void loop() {
} }
delay(50); delay(50);
radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN); radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN);
switch (scancancel) { if (!initdxscan) {
case CORRECTPI: if (radio.rds.correctPI != 0) cancelDXScan(); break; switch (scancancel) {
case SIGNAL: if ((USN < fmscansens * 30) && (WAM < 230) && (OStatus < 80 && OStatus > -80)) cancelDXScan(); break; case CORRECTPI: if (RDSstatus && radio.rds.correctPI != 0) cancelDXScan(); break;
case SIGNAL: if ((USN < fmscansens * 30) && (WAM < 230) && (OStatus < 80 && OStatus > -80)) cancelDXScan(); break;
}
} }
} }
@@ -4480,6 +4484,7 @@ void endMenu() {
} }
void startFMDXScan() { void startFMDXScan() {
initdxscan = true;
if (afscreen || advancedRDS) BuildDisplay(); if (afscreen || advancedRDS) BuildDisplay();
if (memorypos > scanstop || memorypos < scanstart) memorypos = scanstart; if (memorypos > scanstop || memorypos < scanstart) memorypos = scanstart;