Bugfix: AF should not work when in menu or in afpage
This commit is contained in:
+19
-17
@@ -411,7 +411,7 @@ void setup() {
|
||||
break;
|
||||
case BAND_OIRT:
|
||||
if (frequency % FREQ_OIRT_STEP_30K != 0) {
|
||||
Round30K(frequency_OIRT);
|
||||
Round30K(frequency_OIRT);
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
@@ -623,21 +623,11 @@ void loop() {
|
||||
if (power == true) {
|
||||
Communication();
|
||||
|
||||
if (band == BAND_FM && af && radio.rds.correctPI != 0) {
|
||||
if ((aftest && millis() >= aftimer + 3000) || ((USN > 250 || WAM > 250) && millis() >= aftimer + 1000)) {
|
||||
aftimer = millis();
|
||||
aftest = false;
|
||||
frequency = radio.TestAF();
|
||||
if (freqold != frequency) {
|
||||
ShowFreq(0);
|
||||
if (XDRGTKUSB == true || XDRGTKTCP == true) DataPrint("T" + String(frequency * 10));
|
||||
store = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (band == BAND_FM && millis() >= aftimer + 10000) {
|
||||
aftimer = millis();
|
||||
if (USN > 150 || WAM > 150) {
|
||||
if (!menu && !afpage) {
|
||||
if (band == BAND_FM && af && radio.rds.correctPI != 0) {
|
||||
if ((aftest && millis() >= aftimer + 3000) || ((USN > 250 || WAM > 250) && millis() >= aftimer + 1000)) {
|
||||
aftimer = millis();
|
||||
aftest = false;
|
||||
frequency = radio.TestAF();
|
||||
if (freqold != frequency) {
|
||||
ShowFreq(0);
|
||||
@@ -645,6 +635,18 @@ void loop() {
|
||||
store = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (band == BAND_FM && millis() >= aftimer + 10000) {
|
||||
aftimer = millis();
|
||||
if (USN > 150 || WAM > 150) {
|
||||
frequency = radio.TestAF();
|
||||
if (freqold != frequency) {
|
||||
ShowFreq(0);
|
||||
if (XDRGTKUSB == true || XDRGTKTCP == true) DataPrint("T" + String(frequency * 10));
|
||||
store = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4262,7 +4264,7 @@ void ShowFreq(int mode) {
|
||||
Udp.beginPacket(remoteip, 9030);
|
||||
Udp.print("from=TEF tuner;freq=");
|
||||
if (band > BAND_GAP) Udp.print(String(frequency_AM) + "000;ClearRDS=1");
|
||||
else Udp.print(String(band == BAND_FM ? frequency: frequency_OIRT) + "0000;ClearRDS=1");
|
||||
else Udp.print(String(band == BAND_FM ? frequency : frequency_OIRT) + "0000;ClearRDS=1");
|
||||
Udp.endPacket();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user