From c3e3e235a0795dcb961a5b9a48c3f1b58480177b Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Tue, 4 Jun 2024 19:04:53 +0200 Subject: [PATCH] Fixed a problem when using FM scanner with cancel on correct PI --- TEF6686_ESP32.ino | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 7f8c569..b53ae34 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -76,6 +76,7 @@ bool hasCTold; bool haseonold; bool hasrtplusold; bool hastmcold; +bool initdxscan; bool leave; bool LowLevelInit; bool memorystore; @@ -846,6 +847,7 @@ void loop() { if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); } scantimer = millis(); + initdxscan = false; } if (millis() >= flashingtimer + 500) { @@ -861,9 +863,11 @@ void loop() { } delay(50); radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN); - switch (scancancel) { - case CORRECTPI: if (radio.rds.correctPI != 0) cancelDXScan(); break; - case SIGNAL: if ((USN < fmscansens * 30) && (WAM < 230) && (OStatus < 80 && OStatus > -80)) cancelDXScan(); break; + if (!initdxscan) { + switch (scancancel) { + 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() { + initdxscan = true; if (afscreen || advancedRDS) BuildDisplay(); if (memorypos > scanstop || memorypos < scanstart) memorypos = scanstart;