You've already forked TEF6686_ESP32
More change on region selector
This commit is contained in:
@@ -668,8 +668,7 @@ void TEF6686::readRDS(byte showrdserrors) {
|
||||
|
||||
if (!rdsBerrorThreshold) {
|
||||
rds.stationTypeCode = (rds.rdsB >> 5) & 0x1F; // Get 5 PTY bits from Block B
|
||||
if (rds.region == 0) strcpy(rds.stationType, PTY_EU[rds.stationTypeCode]);
|
||||
if (rds.region == 1) strcpy(rds.stationType, PTY_USA[rds.stationTypeCode]);
|
||||
if (rds.region == 0) strcpy(rds.stationType, PTY_EU[rds.stationTypeCode]); else strcpy(rds.stationType, PTY_USA[rds.stationTypeCode]);
|
||||
|
||||
rds.hasTA = (bitRead(rds.rdsB, 4)); // Read TA flag
|
||||
|
||||
|
||||
24
src/gui.cpp
24
src/gui.cpp
@@ -711,8 +711,8 @@ void ShowOneLine(byte position, byte item, bool selected) {
|
||||
|
||||
FullLineSprite.setTextDatum(TR_DATUM);
|
||||
FullLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
|
||||
if (region == REGION_EU) FullLineSprite.drawString(myLanguage[language][47], 298, 2);
|
||||
if (region == REGION_US) FullLineSprite.drawString(myLanguage[language][48], 298, 2);
|
||||
if (radio.rds.region == REGION_EU) FullLineSprite.drawString(myLanguage[language][47], 298, 2);
|
||||
if (radio.rds.region == REGION_US) FullLineSprite.drawString(myLanguage[language][48], 298, 2);
|
||||
break;
|
||||
|
||||
case FMSETTINGS:
|
||||
@@ -1802,8 +1802,8 @@ void ShowOneButton(byte position, byte item, bool selected) {
|
||||
PSSprite.drawString(shortLine(removeNewline(myLanguage[language][46])), 75, 1);
|
||||
|
||||
PSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
|
||||
if (region == REGION_EU) PSSprite.drawString(myLanguage[language][47], 75, 15);
|
||||
if (region == REGION_US) PSSprite.drawString(myLanguage[language][48], 75, 15);
|
||||
if (radio.rds.region == REGION_EU) PSSprite.drawString(myLanguage[language][47], 75, 15);
|
||||
if (radio.rds.region == REGION_US) PSSprite.drawString(myLanguage[language][48], 75, 15);
|
||||
break;
|
||||
|
||||
case FMSETTINGS:
|
||||
@@ -2870,8 +2870,9 @@ void BuildAdvancedRDS() {
|
||||
tftPrint(-1, "ERRORS", 3, 34, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(1, "MHz", 310, 35, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(1, unitString[unit], 310, 51, ActiveColor, ActiveColorSmooth, 16);
|
||||
if (region == REGION_EU) tftPrint(-1, "PI", 216, 81, ActiveColor, ActiveColorSmooth, 16);
|
||||
if (region == REGION_US) {
|
||||
if (radio.rds.region == 0) {
|
||||
tftPrint(-1, "PI", 216, 81, ActiveColor, ActiveColorSmooth, 16);
|
||||
} else {
|
||||
tftPrint(-1, "PI:", 216, 72, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(-1, "ID:", 216, 89, ActiveColor, ActiveColorSmooth, 16);
|
||||
}
|
||||
@@ -3686,12 +3687,11 @@ void MenuUpDown(bool dir) {
|
||||
break;
|
||||
|
||||
case ITEM2:
|
||||
if (region == REGION_EU) region = REGION_US; else region = REGION_EU;
|
||||
if (region == REGION_EU) OneBigLineSprite.drawString(myLanguage[language][47], 135, 0);
|
||||
if (region == REGION_US) OneBigLineSprite.drawString(myLanguage[language][48], 135, 0);
|
||||
if (radio.rds.region == REGION_EU) radio.rds.region = REGION_US; else radio.rds.region = REGION_EU;
|
||||
if (radio.rds.region == REGION_EU) OneBigLineSprite.drawString(myLanguage[language][47], 135, 0);
|
||||
if (radio.rds.region == REGION_US) OneBigLineSprite.drawString(myLanguage[language][48], 135, 0);
|
||||
|
||||
OneBigLineSprite.pushSprite(24, 118);
|
||||
radio.rds.region = region;
|
||||
break;
|
||||
|
||||
case ITEM3:
|
||||
@@ -4916,8 +4916,8 @@ void DoMenu() {
|
||||
case ITEM2:
|
||||
Infoboxprint(myLanguage[language][46]);
|
||||
|
||||
if (region == REGION_EU) OneBigLineSprite.drawString(myLanguage[language][47], 135, 0);
|
||||
if (region == REGION_US) OneBigLineSprite.drawString(myLanguage[language][48], 135, 0);
|
||||
if (radio.rds.region == REGION_EU) OneBigLineSprite.drawString(myLanguage[language][47], 135, 0);
|
||||
if (radio.rds.region == REGION_US) OneBigLineSprite.drawString(myLanguage[language][48], 135, 0);
|
||||
|
||||
OneBigLineSprite.pushSprite(24, 118);
|
||||
break;
|
||||
|
||||
@@ -107,7 +107,6 @@ extern byte MSold;
|
||||
extern byte poweroptions;
|
||||
extern byte eonptyold[20];
|
||||
extern byte rdsblockold;
|
||||
extern byte region;
|
||||
extern byte scancancel;
|
||||
extern byte scanstart;
|
||||
extern byte scanstop;
|
||||
|
||||
26
src/rds.cpp
26
src/rds.cpp
@@ -311,15 +311,13 @@ void readRds() {
|
||||
if (!screenmute && !afscreen) {
|
||||
if (!RDSstatus) {
|
||||
if (radio.rds.correctPI != 0 && !dropout) {
|
||||
if (region == REGION_EU) {
|
||||
if (radio.rds.region == 0) {
|
||||
if (advancedRDS) {
|
||||
tftPrint(0, PIold, 275, 75, RDSDropoutColor, RDSDropoutColorSmooth, 28);
|
||||
} else {
|
||||
tftPrint(0, PIold, 275, 187, RDSDropoutColor, RDSDropoutColorSmooth, 28);
|
||||
}
|
||||
}
|
||||
|
||||
if (region == REGION_US) {
|
||||
} else {
|
||||
if (advancedRDS) {
|
||||
tftPrint(-1, PIold, 240, 72, RDSDropoutColor, RDSDropoutColorSmooth, 16);
|
||||
tftPrint(-1, stationIDold, 240, 89, RDSDropoutColor, RDSDropoutColorSmooth, 16);
|
||||
@@ -360,15 +358,13 @@ void readRds() {
|
||||
}
|
||||
} else {
|
||||
if (dropout || memreset) {
|
||||
if (region == REGION_EU) {
|
||||
if (radio.rds.region == 0) {
|
||||
if (advancedRDS) {
|
||||
tftPrint(0, PIold, 275, 75, RDSColor, RDSColorSmooth, 28);
|
||||
} else {
|
||||
tftPrint(0, PIold, 275, 187, RDSColor, RDSColorSmooth, 28);
|
||||
}
|
||||
}
|
||||
|
||||
if (region == REGION_US) {
|
||||
} else {
|
||||
if (advancedRDS) {
|
||||
tftPrint(-1, PIold, 240, 72, RDSColor, RDSColorSmooth, 16);
|
||||
tftPrint(-1, stationIDold, 240, 89, RDSColor, RDSColorSmooth, 16);
|
||||
@@ -557,7 +553,7 @@ void ShowErrors() {
|
||||
}
|
||||
|
||||
void showPI() {
|
||||
if ((region == REGION_US && (String(radio.rds.picode) != PIold || radio.rds.stationIDtext != stationIDold || radio.rds.stationStatetext != stationStateold)) || (region != REGION_US && String(radio.rds.picode) != PIold)) {
|
||||
if ((radio.rds.region != 0 && (String(radio.rds.picode) != PIold || radio.rds.stationIDtext != stationIDold || radio.rds.stationStatetext != stationStateold)) || (radio.rds.region == 0 && String(radio.rds.picode) != PIold)) {
|
||||
if (!afscreen && !radio.rds.rdsAerror && !radio.rds.rdsBerror && !radio.rds.rdsCerror && !radio.rds.rdsDerror && radio.rds.rdsA != radio.rds.correctPI && PIold.length() > 1) {
|
||||
radio.clearRDS(fullsearchrds);
|
||||
if (RDSSPYUSB) Serial.print("G:\r\nRESET-------\r\n\r\n");
|
||||
@@ -566,14 +562,13 @@ void showPI() {
|
||||
|
||||
if (!screenmute) {
|
||||
if (advancedRDS) {
|
||||
if (region == REGION_EU) {
|
||||
if (radio.rds.region == 0) {
|
||||
if (!RDSstatus) {
|
||||
tftReplace(0, PIold, radio.rds.picode, 275, 75, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 28);
|
||||
} else {
|
||||
tftReplace(0, PIold, radio.rds.picode, 275, 75, RDSColor, RDSColorSmooth, BackgroundColor, 28);
|
||||
}
|
||||
}
|
||||
if (region == REGION_US) {
|
||||
} else {
|
||||
if (!RDSstatus) {
|
||||
if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 72, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||
tftReplace(-1, stationIDold, radio.rds.stationIDtext, 240, 89, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||
@@ -586,14 +581,13 @@ void showPI() {
|
||||
} else if (afscreen) {
|
||||
tftReplace(-1, PIold, radio.rds.picode, 30, 201, BWAutoColor, BWAutoColorSmooth, BackgroundColor, 16);
|
||||
} else {
|
||||
if (region == REGION_EU) {
|
||||
if (radio.rds.region == 0) {
|
||||
if (!RDSstatus) {
|
||||
tftReplace(0, PIold, radio.rds.picode, 275, 187, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 28);
|
||||
} else {
|
||||
tftReplace(0, PIold, radio.rds.picode, 275, 187, RDSColor, RDSColorSmooth, BackgroundColor, 28);
|
||||
}
|
||||
}
|
||||
if (region == REGION_US) {
|
||||
} else {
|
||||
if (!RDSstatus) {
|
||||
if (String(radio.rds.picode) != PIold || radio.rds.stationIDtext != stationIDold) {
|
||||
tftReplace(-1, PIold, radio.rds.picode, 240, 184, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||
@@ -623,7 +617,7 @@ void showPI() {
|
||||
|
||||
void showPTY() {
|
||||
if (strcmp(radio.rds.stationType, programTypePrevious)) {
|
||||
String PTYString = String(radio.rds.stationTypeCode) + ": " + (radio.rds.region == 1 ? radio.rds.stationType : myLanguage[language][228 + radio.rds.stationTypeCode]);
|
||||
String PTYString = String(radio.rds.stationTypeCode) + ": " + (radio.rds.region != 0 ? radio.rds.stationType : myLanguage[language][228 + radio.rds.stationTypeCode]);
|
||||
|
||||
if (radio.rds.stationTypeCode == 32) PTYString = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user