diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 2fc9487..049381b 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -868,8 +868,8 @@ void loop() { if (millis() >= flashingtimer + 500) { flashing = !flashing; if (flashing) { - tft.fillRoundRect(1, 79, 42, 20, 5, ActiveColor); - tftPrint(0, "MEM", 22, 82, BackgroundColor, ActiveColor, 16); + tft.fillRoundRect(1, 79, 42, 20, 5, SecondaryColor); + tftPrint(0, "MEM", 22, 82, BackgroundColor, SecondaryColor, 16); } else { tft.fillRoundRect(1, 79, 42, 20, 5, GreyoutColor); tftPrint(0, "MEM", 22, 82, BackgroundColor, GreyoutColor, 16); @@ -3507,8 +3507,8 @@ void doSquelch() { void updateBW() {//todo air if (BWset == 0) { if (!screenmute && !advancedRDS && !afscreen) { - tft.fillRoundRect(247, 35, 71, 20, 5, ActiveColor); - tftPrint(0, "AUTO BW", 282, 38, BackgroundColor, ActiveColor, 16); + tft.fillRoundRect(247, 35, 71, 20, 5, SecondaryColor); + tftPrint(0, "AUTO BW", 282, 38, BackgroundColor, SecondaryColor, 16); } radio.setFMABandw(); } else { @@ -3523,8 +3523,8 @@ void updateiMS() { if (band < BAND_GAP) { if (iMSset == 0) { if (!screenmute && !advancedRDS && !afscreen) { - tft.fillRoundRect(248, 56, 32, 20, 5, ActiveColor); - tftPrint(0, "iMS", 265, 59, BackgroundColor, ActiveColor, 16); + tft.fillRoundRect(248, 56, 32, 20, 5, SecondaryColor); + tftPrint(0, "iMS", 265, 59, BackgroundColor, SecondaryColor, 16); } radio.setiMS(1); } else { @@ -3541,8 +3541,8 @@ void updateEQ() { if (band < BAND_GAP) { if (EQset == 0) { if (!screenmute && !advancedRDS && !afscreen) { - tft.fillRoundRect(286, 56, 32, 20, 5, ActiveColor); - tftPrint(0, "EQ", 301, 59, BackgroundColor, ActiveColor, 16); + tft.fillRoundRect(286, 56, 32, 20, 5, SecondaryColor); + tftPrint(0, "EQ", 301, 59, BackgroundColor, SecondaryColor, 16); } radio.setEQ(1); } else { @@ -3709,16 +3709,16 @@ void ShowTuneMode() { tftPrint(0, "AUTO", 22, 60, BackgroundColor, GreyoutColor, 16); } - tft.fillRoundRect(1, 35, 42, 20, 5, ActiveColor); - tftPrint(0, "MAN", 22, 38, BackgroundColor, ActiveColor, 16); + tft.fillRoundRect(1, 35, 42, 20, 5, SecondaryColor); + tftPrint(0, "MAN", 22, 38, BackgroundColor, SecondaryColor, 16); tft.fillRoundRect(1, 79, 42, 20, 5, GreyoutColor); tftPrint(0, "MEM", 22, 82, BackgroundColor, GreyoutColor, 16); break; case TUNE_AUTO: - tft.fillRoundRect(1, 57, 42, 20, 5, ActiveColor); - tftPrint(0, "AUTO", 22, 60, BackgroundColor, ActiveColor, 16); + tft.fillRoundRect(1, 57, 42, 20, 5, SecondaryColor); + tftPrint(0, "AUTO", 22, 60, BackgroundColor, SecondaryColor, 16); tft.fillRoundRect(1, 35, 42, 20, 5, GreyoutColor); tftPrint(0, "MAN", 22, 38, BackgroundColor, GreyoutColor, 16); @@ -3747,14 +3747,14 @@ void ShowTuneMode() { tft.fillRoundRect(1, 79, 42, 20, 5, SignificantColor); tftPrint(0, "MEM", 22, 82, BackgroundColor, SignificantColor, 16); } else { - tft.fillRoundRect(1, 79, 42, 20, 5, ActiveColor); - tftPrint(0, "MEM", 22, 82, BackgroundColor, ActiveColor, 16); + tft.fillRoundRect(1, 79, 42, 20, 5, SecondaryColor); + tftPrint(0, "MEM", 22, 82, BackgroundColor, SecondaryColor, 16); } break; case TUNE_MI_BAND: - tft.fillRoundRect(1, 57, 42, 20, 5, ActiveColor); - tftPrint(0, "BAND", 22, 60, BackgroundColor, ActiveColor, 16); + tft.fillRoundRect(1, 57, 42, 20, 5, SecondaryColor); + tftPrint(0, "BAND", 22, 60, BackgroundColor, SecondaryColor, 16); tft.fillRoundRect(1, 35, 42, 20, 5, GreyoutColor); tftPrint(0, "MAN", 22, 38, BackgroundColor, GreyoutColor, 16); @@ -4426,8 +4426,8 @@ void cancelDXScan() { tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); if (!flashing) { - tft.fillRoundRect(1, 79, 42, 20, 5, ActiveColor); - tftPrint(0, "MEM", 22, 82, BackgroundColor, ActiveColor, 16); + tft.fillRoundRect(1, 79, 42, 20, 5, SecondaryColor); + tftPrint(0, "MEM", 22, 82, BackgroundColor, SecondaryColor, 16); } SQ = false; @@ -4639,8 +4639,8 @@ uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, ui band = BAND_FM; tunemode = TUNE_MAN; - tft.drawRect(65, 109, 190, 8, FrameColor); - tft.fillRect(66, 110, 188, 6, GreyoutColor); + tft.drawRect(59, 109, 202, 8, FrameColor); + tft.fillRect(60, 110, 200, 6, GreyoutColor); tftPrint(1, myLanguage[language][272], 120, 155, ActiveColor, ActiveColorSmooth, 16); for (frequency = startfreq * 10; frequency <= stopfreq * 10; frequency += 10) { @@ -4697,7 +4697,7 @@ uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, ui SquelchSprite.drawString(String(counter), 0, 0); SquelchSprite.pushSprite(200, 155); - tft.fillRect(66, 110, 2 * constrain(percent, 0, 94), 6, BarInsignificantColor); + tft.fillRect(60, 110, 2 * percent, 6, BarInsignificantColor); percentold = percent; } diff --git a/src/language.h b/src/language.h index 6b917cb..2410c25 100644 --- a/src/language.h +++ b/src/language.h @@ -1,7 +1,7 @@ #ifndef LANGUAGE_H #define LANGUAGE_H -#define VERSION "v2.11.2" +#define VERSION "v2.11.3" // [number of languages][number of texts] diff --git a/src/rds.cpp b/src/rds.cpp index 55636e2..f4ed69d 100644 --- a/src/rds.cpp +++ b/src/rds.cpp @@ -344,7 +344,7 @@ void readRds() { if (!radio.rds.hasLongPS) { PSSprite.fillSprite(BackgroundColor); PSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false); - PSSprite.drawString(PSold, 0, 4); + PSSprite.drawString(PSold, 0, 2); if (advancedRDS) { PSSprite.pushSprite(36, 72); @@ -400,7 +400,7 @@ void readRds() { if (!radio.rds.hasLongPS) { PSSprite.fillSprite(BackgroundColor); PSSprite.setTextColor(RDSColor, RDSColorSmooth, false); - PSSprite.drawString(PSold, 0, 4); + PSSprite.drawString(PSold, 0, 2); if (advancedRDS) { PSSprite.pushSprite(36, 72); @@ -683,7 +683,7 @@ void showPS() { xPos5 = 0; PSSprite.fillSprite(BackgroundColor); if (RDSstatus) PSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else PSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false); - PSSprite.drawString(stationNameLongString, xPos5, 4); + PSSprite.drawString(stationNameLongString, xPos5, 2); } else { if (millis() - pslongticker >= 5) { if (xPos5 < -PSLongWidth) xPos5 = 0; @@ -698,8 +698,8 @@ void showPS() { } PSSprite.fillSprite(BackgroundColor); if (RDSstatus) PSSprite.setTextColor(RDSColor, RDSColorSmooth, false); else PSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false); - PSSprite.drawString(stationNameLongString, xPos5, 4); - PSSprite.drawString(stationNameLongString, xPos5 + PSLongWidth, 4); + PSSprite.drawString(stationNameLongString, xPos5, 2); + PSSprite.drawString(stationNameLongString, xPos5 + PSLongWidth, 2); pslongticker = millis(); } } @@ -707,7 +707,7 @@ void showPS() { xPos5 = 0; PSSprite.fillSprite(BackgroundColor); if (!RDSstatus || band > BAND_GAP) PSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false); else PSSprite.setTextColor(RDSColor, RDSColorSmooth, false); - PSSprite.drawString(radio.rds.stationName, 0, 4); + PSSprite.drawString(radio.rds.stationName, 0, 2); } if (!screenmute) { if (advancedRDS) { @@ -925,22 +925,22 @@ void ShowAFEON() { if (afpagenr == 3) y = 10; for (byte i = 0; i < radio.eon_counter; i++) { - if (eonpicodeold[i + y] == NULL) { + if (eonpicodeold[i + y] == nullptr) { strcpy(eonpicodeold[i + y], ""); } - if (eonpsold[i + y] == NULL) { + if (eonpsold[i + y] == nullptr) { eonpsold[i + y] = ""; } - if (mappedfreqold[i + y] == NULL) { + if (mappedfreqold[i + y] == 0) { mappedfreqold[i + y] = 0; } - if (mappedfreqold2[i + y] == NULL) { + if (mappedfreqold2[i + y] == 0) { mappedfreqold2[i + y] = 0; } - if (mappedfreqold3[i + y] == NULL) { + if (mappedfreqold3[i + y] == 0) { mappedfreqold3[i + y] = 0; } - if (eonptyold[i + y] == NULL) { + if (eonptyold[i + y] == 0) { eonptyold[i + y] = 0; } @@ -963,151 +963,62 @@ void ShowAFEON() { } if (radio.eon[i + y].mappedfreq > 0) { - tftPrint(1, "FREQ", 156, 32, ActiveColor, ActiveColorSmooth, 16); + tftPrint(1, "MF", 156, 32, ActiveColor, ActiveColorSmooth, 16); if (radio.eon[i + y].mappedfreq != mappedfreqold[i + y]) { char oldFreq[10]; dtostrf(mappedfreqold[i + y] / 100.0, 5, 1, oldFreq); - tftPrint(1, oldFreq, 156, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); + tftPrint(-1, oldFreq, 156, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); } char newFreq[10]; dtostrf(radio.eon[i + y].mappedfreq / 100.0, 5, 1, newFreq); - tftPrint(1, newFreq, 156, 48 + (15 * i), RDSColor, RDSColorSmooth, 16); + tftPrint(-1, newFreq, 156, 48 + (15 * i), RDSDropoutColor, RDSDropoutColorSmooth, 16); mappedfreqold[i + y] = radio.eon[i + y].mappedfreq; } else { - char oldFreq[10]; - dtostrf(mappedfreqold[i + y] / 100.0, 5, 1, oldFreq); - tftPrint(1, oldFreq, 156, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); + tftPrint(-1, "", 156, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); } if (radio.eon[i + y].mappedfreq2 > 0) { + tftPrint(1, "MF2", 214, 32, ActiveColor, ActiveColorSmooth, 16); + if (radio.eon[i + y].mappedfreq2 != mappedfreqold2[i + y]) { char oldFreq2[10]; dtostrf(mappedfreqold2[i + y] / 100.0, 5, 1, oldFreq2); - tftPrint(1, oldFreq2, 196, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); + tftPrint(-1, oldFreq2, 214, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); } char newFreq2[10]; dtostrf(radio.eon[i + y].mappedfreq2 / 100.0, 5, 1, newFreq2); - tftPrint(1, newFreq2, 196, 48 + (15 * i), RDSColor, RDSColorSmooth, 16); + tftPrint(-1, newFreq2, 214, 48 + (15 * i), RDSDropoutColor, RDSDropoutColorSmooth, 16); mappedfreqold2[i + y] = radio.eon[i + y].mappedfreq2; } else { - char oldFreq2[10]; - dtostrf(mappedfreqold2[i + y] / 100.0, 5, 1, oldFreq2); - tftPrint(1, oldFreq2, 196, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); + tftPrint(-1, "", 214, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); } if (radio.eon[i + y].mappedfreq3 > 0) { + tftPrint(1, "MF3", 272, 32, ActiveColor, ActiveColorSmooth, 16); + if (radio.eon[i + y].mappedfreq3 != mappedfreqold3[i + y]) { char oldFreq3[10]; dtostrf(mappedfreqold3[i + y] / 100.0, 5, 1, oldFreq3); - tftPrint(1, oldFreq3, 236, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); + tftPrint(-1, oldFreq3, 272, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); } char newFreq3[10]; dtostrf(radio.eon[i + y].mappedfreq3 / 100.0, 5, 1, newFreq3); - tftPrint(1, newFreq3, 236, 48 + (15 * i), RDSColor, RDSColorSmooth, 16); + tftPrint(-1, newFreq3, 272, 48 + (15 * i), RDSDropoutColor, RDSDropoutColorSmooth, 16); mappedfreqold3[i + y] = radio.eon[i + y].mappedfreq3; } else { - char oldFreq3[10]; - dtostrf(mappedfreqold3[i + y] / 100.0, 5, 1, oldFreq3); - tftPrint(1, oldFreq3, 236, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); + tftPrint(-1, "", 272, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); } - if (radio.eon[i + y].taset) { - if (radio.eon[i + y].ta) { - tft.fillCircle(250, 54 + (15 * i), 4, InsignificantColor); - } else { - tft.fillCircle(250, 54 + (15 * i), 4, BackgroundColor); - } - } else { - tft.fillCircle(250, 54 + (15 * i), 4, BackgroundColor); - } - - if (radio.eon[i + y].tp) { - tft.fillCircle(276, 54 + (15 * i), 4, InsignificantColor); - } else { - tft.fillCircle(276, 54 + (15 * i), 4, BackgroundColor); - } - - if (radio.eon[i + y].pty != eonptyold[i + y]) { - tftReplace(0, String(eonptyold[i + y]), (radio.eon[i + y].pty < 32 ? String(radio.eon[i + y].pty) : " "), 304, 48 + (15 * i), RDSColor, RDSColorSmooth, BackgroundColor, 16); + if (radio.eon[i + y].pty > 0) { + tftPrint(1, String(radio.eon[i + y].pty), 304, 48 + (15 * i), RDSColor, RDSColorSmooth, 16); eonptyold[i + y] = radio.eon[i + y].pty; - } - - if (i == 9) i = 254; - } - } - } - - if (radio.rds.hasAID) { - if (aid_counterold != radio.rds.aid_counter) { - String AIDStringTemp = ""; - char id[5]; - - for (int y = 0; y < radio.rds.aid_counter; y++) { - bool aidProcessed = false; - - for (int i = 0; i < 65; i++) { - if (radio.rds.aid[y] == oda_app_ids[i]) { - if (!aidProcessed) { - for (int z = 0; z < 4; z++) { - uint8_t nibble = (radio.rds.aid[y] >> (4 * (3 - z))) & 0xF; - if (nibble < 10) { - id[z] = nibble + '0'; - } else { - id[z] = nibble - 10 + 'A'; - } - } - id[4] = '\0'; - - AIDStringTemp += String(id); - AIDStringTemp += ": "; - AIDStringTemp += oda_app_names[i]; - - aidProcessed = true; - } - break; - } - } - - if (aidProcessed && y < radio.rds.aid_counter - 1) { - AIDStringTemp += " | "; - } - } - aid_counterold = radio.rds.aid_counter; - - if (AIDStringTemp != AIDStringold) { - AIDString = String(myLanguage[language][93]) + " - " + String(myLanguage[language][79]) + ": " + AIDStringTemp + " "; - AIDWidth = FullLineSprite.textWidth(AIDString); - AIDStringold = AIDString; - } - } - - if (FullLineSprite.textWidth(radio.trimTrailingSpaces(AIDString)) < 270) { - xPos = 0; - FullLineSprite.fillSprite(BackgroundColor); - FullLineSprite.setTextColor(ActiveColor, ActiveColorSmooth, false); - FullLineSprite.drawString(AIDString, xPos, 2); - FullLineSprite.drawLine(283, 0, 283, 19, FrameColor); - FullLineSprite.pushSprite(5, 220); - } else { - if (millis() - rtticker >= 5) { - if (xPos < -AIDWidth) xPos = 0; - if (xPos == 0) { - if (millis() - rttickerhold >= 2000) { - xPos--; - rttickerhold = millis(); - } } else { - xPos--; - rttickerhold = millis(); + tftPrint(-1, String(eonptyold[i + y]), 304, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); } - FullLineSprite.fillSprite(BackgroundColor); - FullLineSprite.setTextColor(ActiveColor, ActiveColorSmooth, false); - FullLineSprite.drawString(AIDString, xPos, 2); - FullLineSprite.drawString(AIDString, xPos + AIDWidth, 2); - FullLineSprite.drawLine(314, 0, 314, 19, FrameColor); - FullLineSprite.pushSprite(5, 220); - rtticker = millis(); + + if (radio.eon[i + y].ta) tftPrint(0, "X", 250, 48 + (15 * i), RDSColor, RDSColorSmooth, 16); else tftPrint(0, "X", 250, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); + if (radio.eon[i + y].tp) tftPrint(0, "X", 276, 48 + (15 * i), RDSColor, RDSColorSmooth, 16); else tftPrint(0, "X", 276, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); } } }