More change on region selector
This commit is contained in:
+15
-13
@@ -211,7 +211,6 @@ byte MSold;
|
||||
byte poweroptions;
|
||||
byte rdsblockold;
|
||||
byte rdsqualityold;
|
||||
byte region;
|
||||
byte rotarymode;
|
||||
byte touchrotating;
|
||||
byte scancancel;
|
||||
@@ -517,7 +516,7 @@ void setup() {
|
||||
band = EEPROM.readByte(EE_BYTE_BAND);
|
||||
LowLevelSet = EEPROM.readByte(EE_BYTE_LOWLEVELSET);
|
||||
memorypos = EEPROM.readByte(EE_BYTE_MEMORYPOS);
|
||||
region = EEPROM.readByte(EE_BYTE_REGION);
|
||||
radio.rds.region = EEPROM.readByte(EE_BYTE_REGION);
|
||||
radio.underscore = EEPROM.readByte(EE_BYTE_RDS_UNDERSCORE);
|
||||
USBmode = EEPROM.readByte(EE_BYTE_USBMODE);
|
||||
wifi = EEPROM.readByte(EE_BYTE_WIFI);
|
||||
@@ -928,7 +927,6 @@ void setup() {
|
||||
radio.setFMNoiseBlanker(fmnb);
|
||||
radio.setAudio(audiomode);
|
||||
radio.setDeemphasis(fmdeemphasis);
|
||||
radio.rds.region = region;
|
||||
radio.setAGC(fmagc);
|
||||
radio.setAMAGC(amagc);
|
||||
if (fmsi) radio.setFMSI(2); else radio.setFMSI(1);
|
||||
@@ -1080,7 +1078,7 @@ void loop() {
|
||||
if (!scanholdflag) delay(100);
|
||||
radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN);
|
||||
|
||||
if (RabbitearsUser.length() && RabbitearsPassword.length() && region == REGION_US && radio.rds.correctPI != 0 && frequency >= 8810 && frequency <= 10790 && !(frequency % 10) && ((frequency / 10) % 2)) {
|
||||
if (RabbitearsUser.length() && RabbitearsPassword.length() && radio.rds.region != 0 && radio.rds.correctPI != 0 && frequency >= 8810 && frequency <= 10790 && !(frequency % 10) && ((frequency / 10) % 2)) {
|
||||
byte i = (frequency / 10 - 881) / 2;
|
||||
if (!rabbitearspi[i]) {
|
||||
rabbitearspi[i] = radio.rds.correctPI;
|
||||
@@ -1246,8 +1244,9 @@ void loop() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (region == REGION_EU) tftPrint(-1, "PI:", 212, 193, ActiveColor, ActiveColorSmooth, 16);
|
||||
if (region == REGION_US) {
|
||||
if (radio.rds.region == 0) {
|
||||
tftPrint(-1, "PI:", 212, 193, ActiveColor, ActiveColorSmooth, 16);
|
||||
} else {
|
||||
tftPrint(-1, "PI:", 212, 184, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(-1, "ID:", 212, 201, ActiveColor, ActiveColorSmooth, 16);
|
||||
}
|
||||
@@ -1278,8 +1277,9 @@ void loop() {
|
||||
tftPrint(0, "M", 7, 128, GreyoutColor, BackgroundColor, 16);
|
||||
tft.fillRect(16, 133, 187, 6, GreyoutColor);
|
||||
}
|
||||
if (region == REGION_EU) tftPrint(-1, "PI:", 212, 193, GreyoutColor, BackgroundColor, 16);
|
||||
if (region == REGION_US) {
|
||||
if (radio.rds.region == 0) {
|
||||
tftPrint(-1, "PI:", 212, 193, GreyoutColor, BackgroundColor, 16);
|
||||
} else {
|
||||
tftPrint(-1, "PI:", 212, 184, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(-1, "ID:", 212, 201, GreyoutColor, BackgroundColor, 16);
|
||||
}
|
||||
@@ -2394,8 +2394,9 @@ void SelectBand() {
|
||||
radio.setAMCoChannel(amcodect, amcodectcount);
|
||||
doBW();
|
||||
if (!screenmute) {
|
||||
if (region == REGION_EU) tftPrint(-1, "PI:", 212, 193, GreyoutColor, BackgroundColor, 16);
|
||||
if (region == REGION_US) {
|
||||
if (radio.rds.region == 0) {
|
||||
tftPrint(-1, "PI:", 212, 193, GreyoutColor, BackgroundColor, 16);
|
||||
} else {
|
||||
tftPrint(-1, "PI:", 212, 184, GreyoutColor, BackgroundColor, 16);
|
||||
tftPrint(-1, "ID:", 212, 201, GreyoutColor, BackgroundColor, 16);
|
||||
}
|
||||
@@ -2428,8 +2429,9 @@ void SelectBand() {
|
||||
freqold = frequency_AM;
|
||||
if (!externaltune && tunemode != TUNE_MEM) CheckBandForbiddenFM();
|
||||
doBW();
|
||||
if (region == REGION_EU) tftPrint(-1, "PI:", 212, 193, ActiveColor, ActiveColorSmooth, 16);
|
||||
if (region == REGION_US) {
|
||||
if (radio.rds.region == 0) {
|
||||
tftPrint(-1, "PI:", 212, 193, ActiveColor, ActiveColorSmooth, 16);
|
||||
} else {
|
||||
tftPrint(-1, "PI:", 212, 184, ActiveColor, ActiveColorSmooth, 16);
|
||||
tftPrint(-1, "ID:", 212, 201, ActiveColor, ActiveColorSmooth, 16);
|
||||
}
|
||||
@@ -4896,7 +4898,7 @@ void endMenu() {
|
||||
EEPROM.writeByte(EE_BYTE_LANGUAGE, language);
|
||||
EEPROM.writeByte(EE_BYTE_SHOWRDSERRORS, showrdserrors);
|
||||
EEPROM.writeByte(EE_BYTE_LOWLEVELSET, LowLevelSet);
|
||||
EEPROM.writeByte(EE_BYTE_REGION, region);
|
||||
EEPROM.writeByte(EE_BYTE_REGION, radio.rds.region);
|
||||
EEPROM.writeByte(EE_BYTE_RDS_UNDERSCORE, radio.underscore);
|
||||
EEPROM.writeByte(EE_BYTE_USBMODE, USBmode);
|
||||
EEPROM.writeByte(EE_BYTE_WIFI, wifi);
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
|
||||
+12
-12
@@ -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;
|
||||
|
||||
+10
-16
@@ -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