- No AF when screen is muted
- No edge beep when screen is muted.
This commit is contained in:
Sjef Verhoeven PE5PVB
2023-08-15 22:29:44 +02:00
parent da19a3d164
commit 6ae1a0266a
2 changed files with 55 additions and 55 deletions

View File

@@ -674,7 +674,7 @@ void setup() {
void loop() { void loop() {
if (digitalRead(BANDBUTTON) == LOW ) BANDBUTTONPress(); if (digitalRead(BANDBUTTON) == LOW ) BANDBUTTONPress();
if (power || poweroptions == DEEP_SLEEP) { if (power || poweroptions == LCD_OFF) {
if (millis() >= tuningtimer + 200) Communication(); if (millis() >= tuningtimer + 200) Communication();
if (!menu && !afscreen) { if (!menu && !afscreen) {
@@ -2121,66 +2121,66 @@ void DoMemoryPosTune() {
} }
void ShowFreq(int mode) { void ShowFreq(int mode) {
if (!screenmute) { if (!setupmode) {
if (!setupmode) { if (band != BAND_FM && band != BAND_OIRT) { // Fix Me :take care of 9K/10K Step
if (band != BAND_FM && band != BAND_OIRT) { // Fix Me :take care of 9K/10K Step if (freqold < 2000 && frequency_AM >= 2000 && stepsize == 0) if (frequency_AM != 27000 && freqold != 144) radio.SetFreqAM(2000);
if (freqold < 2000 && frequency_AM >= 2000 && stepsize == 0) if (frequency_AM != 27000 && freqold != 144) radio.SetFreqAM(2000); if (freqold >= 2000 && frequency_AM < 2000 && stepsize == 0) if (frequency_AM != 144 && freqold != 27000) radio.SetFreqAM(1998);
if (freqold >= 2000 && frequency_AM < 2000 && stepsize == 0) if (frequency_AM != 144 && freqold != 27000) radio.SetFreqAM(1998);
}
} }
}
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A));
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B));
if (band > BAND_GAP) {
sprite1.fillSprite(BackgroundColor);
sprite1.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
sprite1.drawString(String(frequency_AM) + " ", 218, -6);
if (!screenmute) sprite1.pushSprite(46, 46);
freqold = frequency_AM;
if (band == BAND_SW && showSWMIBand) {
DivdeSWMIBand();
updateSWMIBand();
}
} else {
unsigned int freq = 0;
if (band == BAND_FM) freq = frequency + ConverterSet * 100;
if (band == BAND_OIRT) freq = frequency_OIRT;
if (!screenmute) { if (!screenmute) {
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A)); if (advancedRDS) {
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B)); for (int i = 0; i < 33; i++) tft.fillCircle((6 * i) + 10, 133, 2, GreyoutColor);
if (band > BAND_GAP) { 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, 16);
sprite1.fillSprite(BackgroundColor); freqold = freq;
sprite1.setTextColor(PrimaryColor, PrimaryColorSmooth, false); } else if (afscreen) {
sprite1.drawString(String(frequency_AM) + " ", 218, -6); tftReplace(1, String(freqold / 100) + "." + (freqold % 100 < 10 ? "0" : "") + String(freqold % 100) + " MHz", String(freq / 100) + "." + (freq % 100 < 10 ? "0" : "") + String(freq % 100), 290, 201, BWAutoColor, BWAutoColorSmooth, 16);
sprite1.pushSprite(46, 46); freqold = freq;
freqold = frequency_AM;
if (band == BAND_SW && showSWMIBand) {
DivdeSWMIBand();
updateSWMIBand();
}
} else { } else {
unsigned int freq = 0; if (mode == 0) {
if (band == BAND_FM) freq = frequency + ConverterSet * 100; sprite1.fillSprite(BackgroundColor);
if (band == BAND_OIRT) freq = frequency_OIRT; sprite1.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
sprite1.drawString(String(freq / 100) + "." + (freq % 100 < 10 ? "0" : "") + String(freq % 100) + " ", 218, -6);
if (advancedRDS) { sprite1.pushSprite(46, 46);
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, 16);
freqold = freq; freqold = freq;
} else if (afscreen) { } else if (mode == 1) {
tftReplace(1, String(freqold / 100) + "." + (freqold % 100 < 10 ? "0" : "") + String(freqold % 100) + " MHz", String(freq / 100) + "." + (freq % 100 < 10 ? "0" : "") + String(freq % 100), 290, 201, BWAutoColor, BWAutoColorSmooth, 16); sprite1.fillSprite(BackgroundColor);
freqold = freq; sprite1.pushSprite(46, 46);
} else {
if (mode == 0) {
sprite1.fillSprite(BackgroundColor);
sprite1.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
sprite1.drawString(String(freq / 100) + "." + (freq % 100 < 10 ? "0" : "") + String(freq % 100) + " ", 218, -6);
sprite1.pushSprite(46, 46);
freqold = freq;
} else if (mode == 1) {
sprite1.fillSprite(BackgroundColor);
sprite1.pushSprite(46, 46);
}
} }
} }
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A), read_encoder, CHANGE);
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B), read_encoder, CHANGE);
} }
strcpy(programTypePrevious, "0"); }
strcpy(radioIdPrevious, "0"); attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A), read_encoder, CHANGE);
programServicePrevious = "0"; attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B), read_encoder, CHANGE);
rtplusstringold = ""; strcpy(programTypePrevious, "0");
eonstringold = ""; strcpy(radioIdPrevious, "0");
afstringold = ""; programServicePrevious = "0";
rds_clockold = ""; rtplusstringold = "";
rdsreset = true; eonstringold = "";
sprite.fillSprite(BackgroundColor); afstringold = "";
sprite2.fillSprite(BackgroundColor); rds_clockold = "";
rdsreset = true;
sprite.fillSprite(BackgroundColor);
sprite2.fillSprite(BackgroundColor);
if (!screenmute) {
if (advancedRDS) sprite2.pushSprite(35, 220); else if (!afscreen) sprite.pushSprite(38, 220); if (advancedRDS) sprite2.pushSprite(35, 220); else if (!afscreen) sprite.pushSprite(38, 220);
} }

View File

@@ -386,7 +386,7 @@ void TEF6686::readRDS(bool showrdserrors)
afreset = false; afreset = false;
} }
if (rds.region != 1 && (!rds.rdsAerror || (rds.pierrors && !errorfreepi))) { if (rds.region != 1 && ((!rds.rdsAerror && !rds.rdsBerror && !rds.rdsCerror && !rds.rdsDerror) || (rds.pierrors && !errorfreepi))) {
if (rds.rdsA != piold) { if (rds.rdsA != piold) {
piold = rds.rdsA; piold = rds.rdsA;
rds.picode[0] = (rds.rdsA >> 12) & 0xF; rds.picode[0] = (rds.rdsA >> 12) & 0xF;
@@ -402,7 +402,7 @@ void TEF6686::readRDS(bool showrdserrors)
} }
} }
if (!rds.rdsAerror) errorfreepi = true; if (!rds.rdsAerror && !rds.rdsBerror && !rds.rdsCerror && !rds.rdsDerror) errorfreepi = true;
if (!errorfreepi) { if (!errorfreepi) {
if (((rds.rdsErr >> 14) & 0x03) > 2) rds.picode[5] = '?'; else rds.picode[5] = ' '; if (((rds.rdsErr >> 14) & 0x03) > 2) rds.picode[5] = '?'; else rds.picode[5] = ' ';