- 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,7 +2121,6 @@ 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);
@@ -2129,14 +2128,13 @@ void ShowFreq(int mode) {
} }
} }
if (!screenmute) {
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A)); detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A));
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B)); detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B));
if (band > BAND_GAP) { if (band > BAND_GAP) {
sprite1.fillSprite(BackgroundColor); sprite1.fillSprite(BackgroundColor);
sprite1.setTextColor(PrimaryColor, PrimaryColorSmooth, false); sprite1.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
sprite1.drawString(String(frequency_AM) + " ", 218, -6); sprite1.drawString(String(frequency_AM) + " ", 218, -6);
sprite1.pushSprite(46, 46); if (!screenmute) sprite1.pushSprite(46, 46);
freqold = frequency_AM; freqold = frequency_AM;
if (band == BAND_SW && showSWMIBand) { if (band == BAND_SW && showSWMIBand) {
@@ -2148,6 +2146,7 @@ void ShowFreq(int mode) {
if (band == BAND_FM) freq = frequency + ConverterSet * 100; if (band == BAND_FM) freq = frequency + ConverterSet * 100;
if (band == BAND_OIRT) freq = frequency_OIRT; if (band == BAND_OIRT) freq = frequency_OIRT;
if (!screenmute) {
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, 16); 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);
@@ -2168,9 +2167,9 @@ void ShowFreq(int mode) {
} }
} }
} }
}
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A), read_encoder, CHANGE); attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A), read_encoder, CHANGE);
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B), read_encoder, CHANGE); attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B), read_encoder, CHANGE);
}
strcpy(programTypePrevious, "0"); strcpy(programTypePrevious, "0");
strcpy(radioIdPrevious, "0"); strcpy(radioIdPrevious, "0");
programServicePrevious = "0"; programServicePrevious = "0";
@@ -2181,6 +2180,7 @@ void ShowFreq(int mode) {
rdsreset = true; rdsreset = true;
sprite.fillSprite(BackgroundColor); sprite.fillSprite(BackgroundColor);
sprite2.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] = ' ';