From 298488c0dcb2230fb8be1368f174186f9072dae6 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Tue, 2 Jul 2024 14:46:53 +0200 Subject: [PATCH] When no AF is found in mem mode return to last frequency --- TEF6686_ESP32.ino | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 1f69bee..0716929 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -904,6 +904,7 @@ void loop() { } } + bool foundmemaf = false; for (int x = 8750; x <= 10800; x += 10) { if (rotary != 0 || digitalRead(BANDBUTTON) == LOW || digitalRead(MODEBUTTON) == LOW || digitalRead(BWBUTTON) == LOW || digitalRead(ROTARY_BUTTON) == LOW) break; radio.SetFreq(x); @@ -913,10 +914,16 @@ void loop() { } if (radio.rds.correctPI == radio.getBlockA()) { frequency = x; + foundmemaf = true; break; } } + if (!foundmemaf) { + frequency = freqold; + radio.SetFreq(frequency); + } + if (!screenmute) { if (advancedRDS) { leave = true;