diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 88ca144..f563aa9 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -803,6 +803,27 @@ void loop() { if (digitalRead(BANDBUTTON) == LOW ) BANDBUTTONPress(); if (scandxmode) { + if (millis() >= scantimer + (scanhold * 1000)) { + if (scanmem) { + memorypos++; + if (memorypos > scanstop) memorypos = scanstart; + while (IsStationEmpty() || presets[memorypos].band != BAND_FM) { + memorypos++; + if (memorypos > scanstop) { + memorypos = scanstart; + break; + } + } + DoMemoryPosTune(); + ShowMemoryPos(); + } else { + TuneUp(); + ShowFreq(0); + if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); + } + scantimer = millis(); + } + if (millis() >= flashingtimer + 500) { flashing = !flashing; if (flashing) { @@ -830,27 +851,6 @@ void loop() { } } - if (scandxmode && millis() >= scantimer + (scanhold * 1000)) { - if (scanmem) { - memorypos++; - if (memorypos > scanstop) memorypos = scanstart; - while (IsStationEmpty() || presets[memorypos].band != BAND_FM) { - memorypos++; - if (memorypos > scanstop) { - memorypos = scanstart; - break; - } - } - DoMemoryPosTune(); - ShowMemoryPos(); - } else { - TuneUp(); - ShowFreq(0); - if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); - } - scantimer = millis(); - } - if (millis() >= tuningtimer + 200) { if (store) { detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A));