Bugfix: AF should not work when in menu or in afpage
This commit is contained in:
+28
-26
@@ -411,7 +411,7 @@ void setup() {
|
|||||||
break;
|
break;
|
||||||
case BAND_OIRT:
|
case BAND_OIRT:
|
||||||
if (frequency % FREQ_OIRT_STEP_30K != 0) {
|
if (frequency % FREQ_OIRT_STEP_30K != 0) {
|
||||||
Round30K(frequency_OIRT);
|
Round30K(frequency_OIRT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
@@ -623,21 +623,11 @@ void loop() {
|
|||||||
if (power == true) {
|
if (power == true) {
|
||||||
Communication();
|
Communication();
|
||||||
|
|
||||||
if (band == BAND_FM && af && radio.rds.correctPI != 0) {
|
if (!menu && !afpage) {
|
||||||
if ((aftest && millis() >= aftimer + 3000) || ((USN > 250 || WAM > 250) && millis() >= aftimer + 1000)) {
|
if (band == BAND_FM && af && radio.rds.correctPI != 0) {
|
||||||
aftimer = millis();
|
if ((aftest && millis() >= aftimer + 3000) || ((USN > 250 || WAM > 250) && millis() >= aftimer + 1000)) {
|
||||||
aftest = false;
|
aftimer = millis();
|
||||||
frequency = radio.TestAF();
|
aftest = false;
|
||||||
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) {
|
|
||||||
frequency = radio.TestAF();
|
frequency = radio.TestAF();
|
||||||
if (freqold != frequency) {
|
if (freqold != frequency) {
|
||||||
ShowFreq(0);
|
ShowFreq(0);
|
||||||
@@ -645,6 +635,18 @@ void loop() {
|
|||||||
store = true;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -985,10 +987,10 @@ void ShowBandSelectionFM(bool notglanceview, bool normaldisplay) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (normaldisplay) {
|
if (normaldisplay) {
|
||||||
color = PrimaryColor;
|
color = PrimaryColor;
|
||||||
colorSmooth = PrimaryColorSmooth;
|
colorSmooth = PrimaryColorSmooth;
|
||||||
} else {
|
} else {
|
||||||
color = BackgroundColor;
|
color = BackgroundColor;
|
||||||
colorSmooth = BackgroundColor;
|
colorSmooth = BackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1084,10 +1086,10 @@ void ShowBandSelectionAM(bool notglanceview, bool normaldisplay) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (normaldisplay) {
|
if (normaldisplay) {
|
||||||
color = PrimaryColor;
|
color = PrimaryColor;
|
||||||
colorSmooth = PrimaryColorSmooth;
|
colorSmooth = PrimaryColorSmooth;
|
||||||
} else {
|
} else {
|
||||||
color = BackgroundColor;
|
color = BackgroundColor;
|
||||||
colorSmooth = BackgroundColor;
|
colorSmooth = BackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1630,7 +1632,7 @@ void SelectBand() {
|
|||||||
if (tunemode == TUNE_MI_BAND) tunemode = TUNE_MAN;
|
if (tunemode == TUNE_MI_BAND) tunemode = TUNE_MAN;
|
||||||
radio.power(0);
|
radio.power(0);
|
||||||
delay(50);
|
delay(50);
|
||||||
if (band == BAND_FM) radio.SetFreq(frequency);
|
if (band == BAND_FM) radio.SetFreq(frequency);
|
||||||
else if (band == BAND_OIRT) radio.SetFreq(frequency_OIRT);
|
else if (band == BAND_OIRT) radio.SetFreq(frequency_OIRT);
|
||||||
freqold = frequency_AM;
|
freqold = frequency_AM;
|
||||||
CheckBandForbiddenFM();
|
CheckBandForbiddenFM();
|
||||||
@@ -1889,7 +1891,7 @@ void RoundStep() {
|
|||||||
|
|
||||||
while (digitalRead(ROTARY_BUTTON) == LOW) delay(50);
|
while (digitalRead(ROTARY_BUTTON) == LOW) delay(50);
|
||||||
|
|
||||||
if (band == BAND_FM) EEPROM.writeUInt(EE_UINT16_FREQUENCY_FM, frequency);
|
if (band == BAND_FM) EEPROM.writeUInt(EE_UINT16_FREQUENCY_FM, frequency);
|
||||||
else if (band == BAND_OIRT) EEPROM.writeUInt(EE_UINT16_FREQUENCY_OIRT, frequency_OIRT);
|
else if (band == BAND_OIRT) EEPROM.writeUInt(EE_UINT16_FREQUENCY_OIRT, frequency_OIRT);
|
||||||
else EEPROM.writeUInt(EE_UINT16_FREQUENCY_AM, frequency_AM);
|
else EEPROM.writeUInt(EE_UINT16_FREQUENCY_AM, frequency_AM);
|
||||||
EEPROM.commit();
|
EEPROM.commit();
|
||||||
@@ -3027,7 +3029,7 @@ void KeyDown() {
|
|||||||
if (af) af = false; else af = true;
|
if (af) af = false; else af = true;
|
||||||
if (af) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
|
if (af) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 190:
|
case 190:
|
||||||
ShowBandSelectionFM(true, REVERSE);
|
ShowBandSelectionFM(true, REVERSE);
|
||||||
bandFM--;
|
bandFM--;
|
||||||
@@ -4198,7 +4200,7 @@ void ShowFreq(int mode) {
|
|||||||
unsigned int freq;
|
unsigned int freq;
|
||||||
if (band == BAND_FM) freq = frequency + ConverterSet * 100;
|
if (band == BAND_FM) freq = frequency + ConverterSet * 100;
|
||||||
else if (band == BAND_OIRT) freq = frequency_OIRT + ConverterSet * 100;
|
else if (band == BAND_OIRT) freq = frequency_OIRT + ConverterSet * 100;
|
||||||
|
|
||||||
if (advancedRDS) {
|
if (advancedRDS) {
|
||||||
for (int i = 0; i < 33; i++) tft.fillCircle((6 * i) + 10, 133, 2, GreyoutColor);
|
for (int i = 0; i < 33; i++) tft.fillCircle((6 * i) + 10, 133, 2, GreyoutColor);
|
||||||
tftReplace(1, String(freqold / 100) + "." + (freqold % 100 < 10 ? "0" : "") + String(freqold % 100) + " MHz", String(freq / 100) + "." + (freq % 100 < 10 ? "0" : "") + String(freq % 100) + " MHz", 310, 35, PrimaryColor, PrimaryColorSmooth, FONT16);
|
tftReplace(1, String(freqold / 100) + "." + (freqold % 100 < 10 ? "0" : "") + String(freqold % 100) + " MHz", String(freq / 100) + "." + (freq % 100 < 10 ? "0" : "") + String(freq % 100) + " MHz", 310, 35, PrimaryColor, PrimaryColorSmooth, FONT16);
|
||||||
@@ -4261,8 +4263,8 @@ void ShowFreq(int mode) {
|
|||||||
if (wifi) {
|
if (wifi) {
|
||||||
Udp.beginPacket(remoteip, 9030);
|
Udp.beginPacket(remoteip, 9030);
|
||||||
Udp.print("from=TEF tuner;freq=");
|
Udp.print("from=TEF tuner;freq=");
|
||||||
if (band > BAND_GAP) Udp.print(String(frequency_AM) + "000;ClearRDS=1");
|
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();
|
Udp.endPacket();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user