When no AF is found in mem mode return to last frequency

This commit is contained in:
Sjef Verhoeven PE5PVB
2024-07-02 14:46:53 +02:00
parent 4b1c2ceed9
commit 298488c0dc
+7
View File
@@ -904,6 +904,7 @@ void loop() {
} }
} }
bool foundmemaf = false;
for (int x = 8750; x <= 10800; x += 10) { 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; if (rotary != 0 || digitalRead(BANDBUTTON) == LOW || digitalRead(MODEBUTTON) == LOW || digitalRead(BWBUTTON) == LOW || digitalRead(ROTARY_BUTTON) == LOW) break;
radio.SetFreq(x); radio.SetFreq(x);
@@ -913,10 +914,16 @@ void loop() {
} }
if (radio.rds.correctPI == radio.getBlockA()) { if (radio.rds.correctPI == radio.getBlockA()) {
frequency = x; frequency = x;
foundmemaf = true;
break; break;
} }
} }
if (!foundmemaf) {
frequency = freqold;
radio.SetFreq(frequency);
}
if (!screenmute) { if (!screenmute) {
if (advancedRDS) { if (advancedRDS) {
leave = true; leave = true;