Blue-out AF/EON/RT+ ticker on RDS loss

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-11-09 21:19:18 +01:00
parent f306324374
commit 25920aa6ee
5 changed files with 40 additions and 84 deletions
+1 -6
View File
@@ -256,13 +256,11 @@ int8_t CNold;
int8_t VolSet; int8_t VolSet;
float batteryVold; float batteryVold;
IPAddress remoteip; IPAddress remoteip;
String afstringold;
String AIDString; String AIDString;
String cryptedpassword; String cryptedpassword;
String CurrentThemeString; String CurrentThemeString;
String ECColdtxt; String ECColdtxt;
String eonpsold[20]; String eonpsold[20];
String eonstringold;
String LIColdString; String LIColdString;
String pinstringold; String pinstringold;
String PIold; String PIold;
@@ -274,7 +272,6 @@ String rds_clockold;
String RDSSPYRDS; String RDSSPYRDS;
String RDSSPYRDSold; String RDSSPYRDSold;
String RTold; String RTold;
String rtplusstringold;
String salt; String salt;
String saltkey = " "; String saltkey = " ";
String stationIDold; String stationIDold;
@@ -2348,9 +2345,7 @@ 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);
rtplusstringold = "";
eonstringold = "";
afstringold = "";
rdsreset = true; rdsreset = true;
licold = 254; licold = 254;
ECCold = 253; ECCold = 253;
-3
View File
@@ -710,9 +710,6 @@ void BuildAdvancedRDS() {
BWreset = true; BWreset = true;
pinstringold = ""; pinstringold = "";
hasrtplusold = false; hasrtplusold = false;
eonstringold = "";
afstringold = "";
rtplusstringold = "";
afmethodBold = false; afmethodBold = false;
rds_clockold = ""; rds_clockold = "";
ShowMemoryPos(); ShowMemoryPos();
-3
View File
@@ -145,16 +145,13 @@ extern int16_t SStatus;
extern int8_t LevelOffset; extern int8_t LevelOffset;
extern int8_t LowLevelSet; extern int8_t LowLevelSet;
extern int8_t VolSet; extern int8_t VolSet;
extern String afstringold;
extern String CurrentThemeString; extern String CurrentThemeString;
extern String eonpsold[20]; extern String eonpsold[20];
extern String eonstringold;
extern String PIold; extern String PIold;
extern String pinstringold; extern String pinstringold;
extern String PSold; extern String PSold;
extern String ptynold; extern String ptynold;
extern String rds_clockold; extern String rds_clockold;
extern String rtplusstringold;
extern String stationIDold; extern String stationIDold;
extern String stationStateold; extern String stationStateold;
extern String XDRGTK_key; extern String XDRGTK_key;
+6 -36
View File
@@ -69,15 +69,6 @@ void ShowAdvancedRDS() {
hasafold = radio.rds.hasAF; hasafold = radio.rds.hasAF;
} }
if (afstring.length() < 20) {
if (afstringold != afstring) {
xPos2 = 0;
RDSSprite.fillSprite(BackgroundColor);
RDSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
RDSSprite.drawString(afstring, xPos2, 2);
RDSSprite.pushSprite(35, 197);
}
} else {
if (millis() - afticker >= 15) { if (millis() - afticker >= 15) {
if (xPos2 == 0) { if (xPos2 == 0) {
if (millis() - aftickerhold >= 2000) { if (millis() - aftickerhold >= 2000) {
@@ -90,13 +81,11 @@ void ShowAdvancedRDS() {
} }
if (xPos2 < -tft.textWidth(afstring) + (charWidth * 14)) xPos2 = 0; if (xPos2 < -tft.textWidth(afstring) + (charWidth * 14)) xPos2 = 0;
RDSSprite.fillSprite(BackgroundColor); RDSSprite.fillSprite(BackgroundColor);
RDSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); if (RDSstatus) RDSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); else RDSSprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
RDSSprite.drawString(afstring, xPos2, 2); RDSSprite.drawString(afstring, xPos2, 2);
RDSSprite.pushSprite(35, 197); RDSSprite.pushSprite(35, 197);
afticker = millis(); afticker = millis();
} }
}
afstringold = afstring;
String eonstring; String eonstring;
if (radio.rds.hasEON) for (byte i = 0; i < radio.eon_counter; i++) eonstring += String(radio.eon[i].picode) + (radio.eon[i].ps.length() > 0 ? String(": " + String(radio.eon[i].ps)) : "") + (radio.eon[i].mappedfreq > 0 ? String(" " + String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10)) : "") + (radio.eon[i].mappedfreq2 > 0 ? String(" / " + String(radio.eon[i].mappedfreq2 / 100) + "." + String((radio.eon[i].mappedfreq2 % 100) / 10)) : "") + (radio.eon[i].mappedfreq3 > 0 ? String(" / " + String(radio.eon[i].mappedfreq3 / 100) + "." + String((radio.eon[i].mappedfreq3 % 100) / 10)) : "") + (i == radio.eon_counter - 1 ? " " : " | "); else eonstring = myLanguage[language][88]; if (radio.rds.hasEON) for (byte i = 0; i < radio.eon_counter; i++) eonstring += String(radio.eon[i].picode) + (radio.eon[i].ps.length() > 0 ? String(": " + String(radio.eon[i].ps)) : "") + (radio.eon[i].mappedfreq > 0 ? String(" " + String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10)) : "") + (radio.eon[i].mappedfreq2 > 0 ? String(" / " + String(radio.eon[i].mappedfreq2 / 100) + "." + String((radio.eon[i].mappedfreq2 % 100) / 10)) : "") + (radio.eon[i].mappedfreq3 > 0 ? String(" / " + String(radio.eon[i].mappedfreq3 / 100) + "." + String((radio.eon[i].mappedfreq3 % 100) / 10)) : "") + (i == radio.eon_counter - 1 ? " " : " | "); else eonstring = myLanguage[language][88];
@@ -106,15 +95,7 @@ void ShowAdvancedRDS() {
} }
haseonold = radio.rds.hasEON; haseonold = radio.rds.hasEON;
} }
if (eonstring.length() < 20) {
if (eonstringold != eonstring) {
xPos3 = 0;
RDSSprite.fillSprite(BackgroundColor);
RDSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
RDSSprite.drawString(eonstring, xPos3, 2);
RDSSprite.pushSprite(35, 172);
}
} else {
if (millis() - eonticker >= 15) { if (millis() - eonticker >= 15) {
if (xPos3 == 0) { if (xPos3 == 0) {
if (millis() - eontickerhold >= 2000) { if (millis() - eontickerhold >= 2000) {
@@ -127,13 +108,12 @@ void ShowAdvancedRDS() {
} }
if (xPos3 < -tft.textWidth(eonstring) + (charWidth * 14)) xPos3 = 0; if (xPos3 < -tft.textWidth(eonstring) + (charWidth * 14)) xPos3 = 0;
RDSSprite.fillSprite(BackgroundColor); RDSSprite.fillSprite(BackgroundColor);
RDSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); if (RDSstatus) RDSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); else RDSSprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
RDSSprite.drawString(eonstring, xPos3, 2); RDSSprite.drawString(eonstring, xPos3, 2);
RDSSprite.pushSprite(35, 172); RDSSprite.pushSprite(35, 172);
eonticker = millis(); eonticker = millis();
} }
}
eonstringold = eonstring;
String rtplusstring; String rtplusstring;
if (radio.rds.hasRDSplus) rtplusstring = (radio.rds.rdsplusTag1 != 169 ? String(myLanguage[language][radio.rds.rdsplusTag1]) + ": " + String(radio.rds.RTContent1) : "") + (radio.rds.rdsplusTag2 != 169 ? " - " + String(myLanguage[language][radio.rds.rdsplusTag2]) + ": " + String(radio.rds.RTContent2) : "") + " "; else rtplusstring = myLanguage[language][89]; if (radio.rds.hasRDSplus) rtplusstring = (radio.rds.rdsplusTag1 != 169 ? String(myLanguage[language][radio.rds.rdsplusTag1]) + ": " + String(radio.rds.RTContent1) : "") + (radio.rds.rdsplusTag2 != 169 ? " - " + String(myLanguage[language][radio.rds.rdsplusTag2]) + ": " + String(radio.rds.RTContent2) : "") + " "; else rtplusstring = myLanguage[language][89];
@@ -143,15 +123,7 @@ void ShowAdvancedRDS() {
} }
hasrtplusold = radio.rds.hasRDSplus; hasrtplusold = radio.rds.hasRDSplus;
} }
if (rtplusstring.length() < 20) {
if (rtplusstringold != rtplusstring) {
xPos4 = 0;
RDSSprite.fillSprite(BackgroundColor);
RDSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
RDSSprite.drawString(rtplusstring, xPos4, 2);
RDSSprite.pushSprite(35, 146);
}
} else {
if (millis() - rtplusticker >= 15) { if (millis() - rtplusticker >= 15) {
if (xPos4 == 0) { if (xPos4 == 0) {
if (millis() - rtplustickerhold >= 2000) { if (millis() - rtplustickerhold >= 2000) {
@@ -164,13 +136,11 @@ void ShowAdvancedRDS() {
} }
if (xPos4 < -tft.textWidth(rtplusstring) + (charWidth * 14)) xPos4 = 0; if (xPos4 < -tft.textWidth(rtplusstring) + (charWidth * 14)) xPos4 = 0;
RDSSprite.fillSprite(BackgroundColor); RDSSprite.fillSprite(BackgroundColor);
RDSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); if (RDSstatus) RDSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); else RDSSprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
RDSSprite.drawString(rtplusstring, xPos4, 2); RDSSprite.drawString(rtplusstring, xPos4, 2);
RDSSprite.pushSprite(35, 146); RDSSprite.pushSprite(35, 146);
rtplusticker = millis(); rtplusticker = millis();
} }
}
rtplusstringold = rtplusstring;
if (TPold != radio.rds.hasTP) { if (TPold != radio.rds.hasTP) {
if (!screenmute) { if (!screenmute) {
-3
View File
@@ -71,11 +71,9 @@ extern int xPos2;
extern int xPos3; extern int xPos3;
extern int xPos4; extern int xPos4;
extern IPAddress remoteip; extern IPAddress remoteip;
extern String afstringold;
extern String AIDString; extern String AIDString;
extern String ECColdtxt; extern String ECColdtxt;
extern String eonpsold[20]; extern String eonpsold[20];
extern String eonstringold;
extern String LIColdString; extern String LIColdString;
extern String pinstringold; extern String pinstringold;
extern String PIold; extern String PIold;
@@ -87,7 +85,6 @@ extern String rds_clockold;
extern String RDSSPYRDS; extern String RDSSPYRDS;
extern String RDSSPYRDSold; extern String RDSSPYRDSold;
extern String RTold; extern String RTold;
extern String rtplusstringold;
extern String stationIDold; extern String stationIDold;
extern String stationStateold; extern String stationStateold;
extern String XDRGTKRDS; extern String XDRGTKRDS;