Fix on color when RDS is lost.

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-11-21 14:42:13 +01:00
parent 62d1e95213
commit c2d89bab24
3 changed files with 57 additions and 12 deletions
+3 -1
View File
@@ -597,7 +597,6 @@ void BuildMenu() {
} }
void BuildAdvancedRDS() { void BuildAdvancedRDS() {
rdsreset = true;
afscreen = false; afscreen = false;
afpage = false; afpage = false;
afpagenr = 1; afpagenr = 1;
@@ -721,6 +720,8 @@ void BuildAdvancedRDS() {
hasrtplusold = false; hasrtplusold = false;
afmethodBold = false; afmethodBold = false;
rds_clockold = ""; rds_clockold = "";
dropout = false;
rdsreset = true;
ShowMemoryPos(); ShowMemoryPos();
} }
@@ -849,6 +850,7 @@ void BuildDisplay() {
stationIDold = " "; stationIDold = " ";
stationStateold = " "; stationStateold = " ";
BWreset = true; BWreset = true;
dropout = false;
if (band < BAND_GAP) tftPrint(-1, "MHz", 258, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 28); else tftPrint(-1, "kHz", 258, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 28); if (band < BAND_GAP) tftPrint(-1, "MHz", 258, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 28); else tftPrint(-1, "kHz", 258, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 28);
} }
+1
View File
@@ -35,6 +35,7 @@ extern bool artheadold;
extern bool BWreset; extern bool BWreset;
extern bool change; extern bool change;
extern bool compressedold; extern bool compressedold;
extern bool dropout;
extern bool dynamicPTYold; extern bool dynamicPTYold;
extern bool dynamicspi; extern bool dynamicspi;
extern bool edgebeep; extern bool edgebeep;
+45 -3
View File
@@ -404,19 +404,41 @@ void showPI() {
} }
if (!screenmute) { if (!screenmute) {
if (advancedRDS) { if (advancedRDS) {
if (region == REGION_EU) tftReplace(0, PIold, radio.rds.picode, 275, 75, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_EU) {
if (!RDSstatus) {
tftReplace(0, PIold, radio.rds.picode, 275, 75, SecondaryColor, SecondaryColorSmooth, 28);
} else {
tftReplace(0, PIold, radio.rds.picode, 275, 75, PrimaryColor, PrimaryColorSmooth, 28);
}
}
if (region == REGION_US) { if (region == REGION_US) {
if (!RDSstatus) {
if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 72, SecondaryColor, SecondaryColorSmooth, 16);
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 89, SecondaryColor, SecondaryColorSmooth, 16);
} else {
if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 72, PrimaryColor, PrimaryColorSmooth, 16); if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 72, PrimaryColor, PrimaryColorSmooth, 16);
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 89, PrimaryColor, PrimaryColorSmooth, 16); tftReplace(-1, stationIDold, radio.rds.stationID, 240, 89, PrimaryColor, PrimaryColorSmooth, 16);
}
tftReplace(1, stationStateold, radio.rds.stationState, 318, 89, SecondaryColor, SecondaryColorSmooth, 16); tftReplace(1, stationStateold, radio.rds.stationState, 318, 89, SecondaryColor, SecondaryColorSmooth, 16);
} }
} else if (afscreen) { } else if (afscreen) {
tftReplace(-1, PIold, radio.rds.picode, 30, 201, BWAutoColor, BWAutoColorSmooth, 16); tftReplace(-1, PIold, radio.rds.picode, 30, 201, BWAutoColor, BWAutoColorSmooth, 16);
} else { } else {
if (region == REGION_EU) tftReplace(0, PIold, radio.rds.picode, 275, 187, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_EU) {
if (!RDSstatus) {
tftReplace(0, PIold, radio.rds.picode, 275, 187, SecondaryColor, SecondaryColorSmooth, 28);
} else {
tftReplace(0, PIold, radio.rds.picode, 275, 187, PrimaryColor, PrimaryColorSmooth, 28);
}
}
if (region == REGION_US) { if (region == REGION_US) {
if (RDSstatus) {
if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 184, SecondaryColor, SecondaryColorSmooth, 16);
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 201, SecondaryColor, SecondaryColorSmooth, 16);
} else {
if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 184, PrimaryColor, PrimaryColorSmooth, 16); if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 184, PrimaryColor, PrimaryColorSmooth, 16);
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 201, PrimaryColor, PrimaryColorSmooth, 16); tftReplace(-1, stationIDold, radio.rds.stationID, 240, 201, PrimaryColor, PrimaryColorSmooth, 16);
}
tftReplace(1, stationStateold, radio.rds.stationState, 318, 201, SecondaryColor, SecondaryColorSmooth, 16); tftReplace(1, stationStateold, radio.rds.stationState, 318, 201, SecondaryColor, SecondaryColorSmooth, 16);
} }
} }
@@ -435,7 +457,19 @@ void showPI() {
void showPTY() { void showPTY() {
if (strcmp(radio.rds.stationType, programTypePrevious)) { if (strcmp(radio.rds.stationType, programTypePrevious)) {
if (!screenmute) { if (!screenmute) {
if (advancedRDS) tftReplace(-1, PTYold, radio.rds.stationType, 38, 109, PrimaryColor, PrimaryColorSmooth, 16); else tftReplace(-1, PTYold, radio.rds.stationType, 38, 163, PrimaryColor, PrimaryColorSmooth, 16); if (advancedRDS) {
if (!RDSstatus) {
tftReplace(-1, PTYold, radio.rds.stationType, 38, 109, SecondaryColor, SecondaryColorSmooth, 16);
} else {
tftReplace(-1, PTYold, radio.rds.stationType, 38, 109, PrimaryColor, PrimaryColorSmooth, 16);
}
} else {
if (!RDSstatus) {
tftReplace(-1, PTYold, radio.rds.stationType, 38, 163, SecondaryColor, SecondaryColorSmooth, 16);
} else {
tftReplace(-1, PTYold, radio.rds.stationType, 38, 163, PrimaryColor, PrimaryColorSmooth, 16);
}
}
} }
PTYold = radio.rds.stationType; PTYold = radio.rds.stationType;
if (wifi) { if (wifi) {
@@ -452,13 +486,21 @@ void showPS() {
if (radio.rds.stationName != PSold) { if (radio.rds.stationName != PSold) {
if (!screenmute) { if (!screenmute) {
if (advancedRDS) { if (advancedRDS) {
if (!RDSstatus) {
tftReplace(-1, PSold, radio.rds.stationName, 38, 75, SecondaryColor, SecondaryColorSmooth, 28);
} else {
tftReplace(-1, PSold, radio.rds.stationName, 38, 75, PrimaryColor, PrimaryColorSmooth, 28); tftReplace(-1, PSold, radio.rds.stationName, 38, 75, PrimaryColor, PrimaryColorSmooth, 28);
}
} else if (afscreen) { } else if (afscreen) {
tftReplace(0, PSold, radio.rds.stationName, 160, 201, BWAutoColor, BWAutoColorSmooth, 16); tftReplace(0, PSold, radio.rds.stationName, 160, 201, BWAutoColor, BWAutoColorSmooth, 16);
} else {
if (!RDSstatus) {
tftReplace(-1, PSold, radio.rds.stationName, 38, 187, SecondaryColor, SecondaryColorSmooth, 28);
} else { } else {
tftReplace(-1, PSold, radio.rds.stationName, 38, 187, PrimaryColor, PrimaryColorSmooth, 28); tftReplace(-1, PSold, radio.rds.stationName, 38, 187, PrimaryColor, PrimaryColorSmooth, 28);
} }
} }
}
PSold = radio.rds.stationName; PSold = radio.rds.stationName;
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);