You've already forked TEF6686_ESP32
Fix on color when RDS is lost.
This commit is contained in:
@@ -597,7 +597,6 @@ void BuildMenu() {
|
||||
}
|
||||
|
||||
void BuildAdvancedRDS() {
|
||||
rdsreset = true;
|
||||
afscreen = false;
|
||||
afpage = false;
|
||||
afpagenr = 1;
|
||||
@@ -721,6 +720,8 @@ void BuildAdvancedRDS() {
|
||||
hasrtplusold = false;
|
||||
afmethodBold = false;
|
||||
rds_clockold = "";
|
||||
dropout = false;
|
||||
rdsreset = true;
|
||||
ShowMemoryPos();
|
||||
}
|
||||
|
||||
@@ -849,6 +850,7 @@ void BuildDisplay() {
|
||||
stationIDold = " ";
|
||||
stationStateold = " ";
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -2514,4 +2516,4 @@ void Infoboxprint(const char* input) {
|
||||
} else {
|
||||
tftPrint(0, input, 155, 78, ActiveColor, ActiveColorSmooth, 28);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,7 @@ extern bool artheadold;
|
||||
extern bool BWreset;
|
||||
extern bool change;
|
||||
extern bool compressedold;
|
||||
extern bool dropout;
|
||||
extern bool dynamicPTYold;
|
||||
extern bool dynamicspi;
|
||||
extern bool edgebeep;
|
||||
|
||||
62
src/rds.cpp
62
src/rds.cpp
@@ -404,19 +404,41 @@ void showPI() {
|
||||
}
|
||||
if (!screenmute) {
|
||||
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 (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);
|
||||
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);
|
||||
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 89, PrimaryColor, PrimaryColorSmooth, 16);
|
||||
}
|
||||
tftReplace(1, stationStateold, radio.rds.stationState, 318, 89, SecondaryColor, SecondaryColorSmooth, 16);
|
||||
}
|
||||
} else if (afscreen) {
|
||||
tftReplace(-1, PIold, radio.rds.picode, 30, 201, BWAutoColor, BWAutoColorSmooth, 16);
|
||||
} 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 (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);
|
||||
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);
|
||||
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 201, PrimaryColor, PrimaryColorSmooth, 16);
|
||||
}
|
||||
tftReplace(1, stationStateold, radio.rds.stationState, 318, 201, SecondaryColor, SecondaryColorSmooth, 16);
|
||||
}
|
||||
}
|
||||
@@ -435,7 +457,19 @@ void showPI() {
|
||||
void showPTY() {
|
||||
if (strcmp(radio.rds.stationType, programTypePrevious)) {
|
||||
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;
|
||||
if (wifi) {
|
||||
@@ -452,11 +486,19 @@ void showPS() {
|
||||
if (radio.rds.stationName != PSold) {
|
||||
if (!screenmute) {
|
||||
if (advancedRDS) {
|
||||
tftReplace(-1, PSold, radio.rds.stationName, 38, 75, PrimaryColor, PrimaryColorSmooth, 28);
|
||||
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);
|
||||
}
|
||||
} else if (afscreen) {
|
||||
tftReplace(0, PSold, radio.rds.stationName, 160, 201, BWAutoColor, BWAutoColorSmooth, 16);
|
||||
} else {
|
||||
tftReplace(-1, PSold, radio.rds.stationName, 38, 187, PrimaryColor, PrimaryColorSmooth, 28);
|
||||
if (!RDSstatus) {
|
||||
tftReplace(-1, PSold, radio.rds.stationName, 38, 187, SecondaryColor, SecondaryColorSmooth, 28);
|
||||
} else {
|
||||
tftReplace(-1, PSold, radio.rds.stationName, 38, 187, PrimaryColor, PrimaryColorSmooth, 28);
|
||||
}
|
||||
}
|
||||
}
|
||||
PSold = radio.rds.stationName;
|
||||
@@ -764,4 +806,4 @@ void ShowAFEON() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
#pragma GCC diagnostic pop
|
||||
Reference in New Issue
Block a user