Updated AF Method B

- Added S (Same program)
- Changed color and allignment of these characters
- Renamed AF-R to AF-B
- Small fix on LIC
This commit is contained in:
Sjef Verhoeven PE5PVB
2023-10-14 23:59:43 +02:00
parent a023be0524
commit f51bf0cdb0
4 changed files with 128 additions and 110 deletions
+43 -29
View File
@@ -528,9 +528,12 @@ void TEF6686::readRDS(byte showrdserrors)
//AF decoder //AF decoder
if (rdsblock == 0) { // Only when in GROUP 0A if (rdsblock == 0) { // Only when in GROUP 0A
if ((rds.rdsC >> 8) > 224 && (rds.rdsC >> 8) < 250 && ((rds.rdsC & 0xFF) * 10 + 8750) == currentfreq && !afmethodB) { // Check for AF method B if ((rds.rdsC >> 8) > 224 && (rds.rdsC >> 8) < 250 && ((rds.rdsC & 0xFF) * 10 + 8750) == currentfreq) { // Check for AF method B
afmethodB = true; afmethodB = true;
afmethodBprobe = true;
af_updatecounter++; af_updatecounter++;
} else if ((rds.rdsC >> 8) > 224 && (rds.rdsC >> 8) < 250 && ((rds.rdsC & 0xFF) * 10 + 8750) == !currentfreq) {
afmethodBprobe = false;
} }
if (((rds.rdsC >> 8) > 0 && (rds.rdsC >> 8) > 224) && ((rds.rdsC >> 8) > 0 && (rds.rdsC >> 8) < 250)) afinit = true; if (((rds.rdsC >> 8) > 0 && (rds.rdsC >> 8) > 224) && ((rds.rdsC >> 8) > 0 && (rds.rdsC >> 8) < 250)) afinit = true;
@@ -543,38 +546,48 @@ void TEF6686::readRDS(byte showrdserrors)
if ((rds.rdsC & 0xFF) > 0 && (rds.rdsC & 0xFF) < 205) buffer1 = (rds.rdsC & 0xFF) * 10 + 8750; else buffer1 = 0; if ((rds.rdsC & 0xFF) > 0 && (rds.rdsC & 0xFF) < 205) buffer1 = (rds.rdsC & 0xFF) * 10 + 8750; else buffer1 = 0;
if (buffer0 != 0 || buffer1 != 0) rds.hasAF = true; if (buffer0 != 0 || buffer1 != 0) rds.hasAF = true;
if (buffer1 == currentfreq && buffer0 > buffer1) { if (afmethodBprobe) {
for (int x = 0; x < af_counter; x++) { if (buffer1 == currentfreq && buffer0 > buffer1) {
if (af[x].frequency == buffer0 && !af[x].regional) { for (int x = 0; x < af_counter; x++) {
af[x].regional = true; if (af[x].frequency == buffer0 && !af[x].regional) {
af_updatecounter++; if (!af[x].regional) {
break; af[x].regional = true;
af_updatecounter++;
}
break;
}
}
} else if (buffer1 == currentfreq && buffer0 < buffer1) {
for (int x = 0; x < af_counter; x++) {
if (af[x].frequency == buffer0 && !af[x].mixed) {
if (!af[x].mixed) {
af[x].mixed = true;
af_updatecounter++;
}
break;
}
} }
} }
} else if (buffer1 == currentfreq && buffer0 < buffer1) {
for (int x = 0; x < af_counter; x++) {
if (af[x].frequency == buffer0 && !af[x].mixed) {
af[x].mixed = true;
af_updatecounter++;
break;
}
}
}
if (buffer0 == currentfreq && buffer0 > buffer1) { if (buffer0 == currentfreq && buffer0 > buffer1) {
for (int x = 0; x < af_counter; x++) { for (int x = 0; x < af_counter; x++) {
if (af[x].frequency == buffer1 && !af[x].regional) { if (af[x].frequency == buffer1 && !af[x].regional) {
af[x].regional = true; if (!af[x].regional) {
af_updatecounter++; af[x].regional = true;
break; af_updatecounter++;
}
break;
}
} }
} } else if (buffer0 == currentfreq && buffer0 < buffer1) {
} else if (buffer0 == currentfreq && buffer0 < buffer1) { for (int x = 0; x < af_counter; x++) {
for (int x = 0; x < af_counter; x++) { if (af[x].frequency == buffer0 && !af[x].mixed) {
if (af[x].frequency == buffer0 && !af[x].mixed) { if (!af[x].mixed) {
af[x].mixed = true; af[x].mixed = true;
af_updatecounter++; af_updatecounter++;
break; }
break;
}
} }
} }
} }
@@ -1077,6 +1090,7 @@ void TEF6686::clearRDS (bool fullsearchrds)
packet2 = false; packet2 = false;
packet3 = false; packet3 = false;
rds.aid_counter = 0; rds.aid_counter = 0;
afmethodBprobe = false;
} }
void TEF6686::tone(uint16_t time, int16_t amplitude, uint16_t frequency) { void TEF6686::tone(uint16_t time, int16_t amplitude, uint16_t frequency) {
+73 -72
View File
@@ -85,81 +85,81 @@ static const char* const PTY_USA[] {
}; };
static const uint16_t oda_app_ids[] { static const uint16_t oda_app_ids[] {
0x0000, 0x0093, 0x0BCB, 0x0C24, 0x0CC1, 0x0D45, 0x0D8B, 0x0E2C, 0x0E31, 0x0F87, 0x0000, 0x0093, 0x0BCB, 0x0C24, 0x0CC1, 0x0D45, 0x0D8B, 0x0E2C, 0x0E31, 0x0F87,
0x125F, 0x1BDA, 0x1C5E, 0x1C68, 0x1CB1, 0x1D47, 0x1DC2, 0x1DC5, 0x1E8F, 0x4400, 0x125F, 0x1BDA, 0x1C5E, 0x1C68, 0x1CB1, 0x1D47, 0x1DC2, 0x1DC5, 0x1E8F, 0x4400,
0x4AA1, 0x4AB7, 0x4BA2, 0x4BD7, 0x4BD8, 0x4C59, 0x4D87, 0x4D95, 0x4D9A, 0x50DD, 0x4AA1, 0x4AB7, 0x4BA2, 0x4BD7, 0x4BD8, 0x4C59, 0x4D87, 0x4D95, 0x4D9A, 0x50DD,
0x5757, 0x6363, 0x6365, 0x6552, 0x6A7A, 0x7373, 0xA112, 0xA911, 0xABCF, 0xC350, 0x5757, 0x6363, 0x6365, 0x6552, 0x6A7A, 0x7373, 0xA112, 0xA911, 0xABCF, 0xC350,
0xC3A1, 0xC3B0, 0xC3C3, 0xC4D4, 0xC549, 0xC563, 0xC6A7, 0xC737, 0xCB73, 0xCB97, 0xC3A1, 0xC3B0, 0xC3C3, 0xC4D4, 0xC549, 0xC563, 0xC6A7, 0xC737, 0xCB73, 0xCB97,
0xCC21, 0xCD46, 0xCD47, 0xCD9E, 0xCE6B, 0xE123, 0xE1C1, 0xE319, 0xE411, 0xE440, 0xCC21, 0xCD46, 0xCD47, 0xCD9E, 0xCE6B, 0xE123, 0xE1C1, 0xE319, 0xE411, 0xE440,
0xE4A6, 0xE5D7, 0xE911, 0xFF7F, 0xFF80 0xE4A6, 0xE5D7, 0xE911, 0xFF7F, 0xFF80
}; };
static const char* const oda_app_names[] { static const char* const oda_app_names[] {
"None", "None",
"Cross referencing DAB within RDS", "Cross referencing DAB within RDS",
"Leisure & Practical Info for Drivers", "Leisure & Practical Info for Drivers",
"ELECTRABEL-DSM 7", "ELECTRABEL-DSM 7",
"Wireless Playground broadcast control signal", "Wireless Playground broadcast control signal",
"RDS-TMC: ALERT-C / EN ISO 14819-1", "RDS-TMC: ALERT-C / EN ISO 14819-1",
"ELECTRABEL-DSM 18", "ELECTRABEL-DSM 18",
"ELECTRABEL-DSM 3", "ELECTRABEL-DSM 3",
"ELECTRABEL-DSM 13", "ELECTRABEL-DSM 13",
"ELECTRABEL-DSM 2", "ELECTRABEL-DSM 2",
"I-FM-RDS for fixed and mobile devices", "I-FM-RDS for fixed and mobile devices",
"ELECTRABEL-DSM 1", "ELECTRABEL-DSM 1",
"ELECTRABEL-DSM 20", "ELECTRABEL-DSM 20",
"ITIS In-vehicle data base", "ITIS In-vehicle data base",
"ELECTRABEL-DSM 10", "ELECTRABEL-DSM 10",
"ELECTRABEL-DSM 4", "ELECTRABEL-DSM 4",
"CITIBUS 4", "CITIBUS 4",
"Encrypted TTI using ALERT-Plus", "Encrypted TTI using ALERT-Plus",
"ELECTRABEL-DSM 17", "ELECTRABEL-DSM 17",
"RDS-Light", "RDS-Light",
"RASANT", "RASANT",
"ELECTRABEL-DSM 9", "ELECTRABEL-DSM 9",
"ELECTRABEL-DSM 5", "ELECTRABEL-DSM 5",
"RadioText+ (RT+)", "RadioText+ (RT+)",
"RadioText Plus / RT+for eRT", "RadioText Plus / RT+for eRT",
"CITIBUS 2", "CITIBUS 2",
"Radio Commerce System (RCS)", "Radio Commerce System (RCS)",
"ELECTRABEL-DSM 16", "ELECTRABEL-DSM 16",
"ELECTRABEL-DSM 11", "ELECTRABEL-DSM 11",
"To warn people in case of disasters or emergency", "To warn people in case of disasters or emergency",
"Personal weather station", "Personal weather station",
"Hybradio RDS-Net(for testing use, only)", "Hybradio RDS-Net(for testing use, only)",
"RDS2 9 bit AF lists ODA", "RDS2 9 bit AF lists ODA",
"Enhanced RadioText (eRT)", "Enhanced RadioText (eRT)",
"Warning receiver", "Warning receiver",
"Enhanced early warning system", "Enhanced early warning system",
"NL _ Alert system", "NL _ Alert system",
"Data FM Selective Multipoint Messaging", "Data FM Selective Multipoint Messaging",
"RF Power Monitoring", "RF Power Monitoring",
"NRSC Song Title and Artist", "NRSC Song Title and Artist",
"Personal Radio Service", "Personal Radio Service",
"iTunes Tagging", "iTunes Tagging",
"NAVTEQ Traffic Plus", "NAVTEQ Traffic Plus",
"eEAS", "eEAS",
"Smart Grid Broadcast Channel", "Smart Grid Broadcast Channel",
"ID Logic", "ID Logic",
"Veil Enabled Interactive Device", "Veil Enabled Interactive Device",
"Utility Message Channel (UMC)", "Utility Message Channel (UMC)",
"CITIBUS 1", "CITIBUS 1",
"ELECTRABEL-DSM 14", "ELECTRABEL-DSM 14",
"CITIBUS 3", "CITIBUS 3",
"RDS-TMC: ALERT-C", "RDS-TMC: ALERT-C",
"RDS-TMC: ALERT-C", "RDS-TMC: ALERT-C",
"ELECTRABEL-DSM 8", "ELECTRABEL-DSM 8",
"Encrypted TTI using ALERT-Plus", "Encrypted TTI using ALERT-Plus",
"APS Gateway", "APS Gateway",
"Action code", "Action code",
"ELECTRABEL-DSM 12", "ELECTRABEL-DSM 12",
"Beacon downlink", "Beacon downlink",
"ELECTRABEL-DSM 15", "ELECTRABEL-DSM 15",
"ELECTRABEL-DSM 19", "ELECTRABEL-DSM 19",
"ELECTRABEL-DSM 6", "ELECTRABEL-DSM 6",
"EAS open protocol", "EAS open protocol",
"RFT: Station logo", "RFT: Station logo",
"RFT+ (work title)" "RFT+ (work title)"
}; };
typedef struct _rds_ { typedef struct _rds_ {
@@ -342,5 +342,6 @@ class TEF6686 {
bool packet1; bool packet1;
bool packet2; bool packet2;
bool packet3; bool packet3;
bool afmethodBprobe;
}; };
#endif #endif
+1 -1
View File
@@ -648,7 +648,7 @@ void BuildAdvancedRDS() {
tftPrint(-1, "TP", 2, 51, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "TP", 2, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "TA", 21, 51, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "TA", 21, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "AF", 42, 51, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "AF", 42, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "-R", 60, 51, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "-B", 60, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "CT", 78, 51, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "CT", 78, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "TMC", 95, 51, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "TMC", 95, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "RT+", 130, 51, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "RT+", 130, 51, GreyoutColor, BackgroundColor, 16);
+11 -8
View File
@@ -56,7 +56,7 @@ void ShowAdvancedRDS() {
if (!screenmute) tftPrint(-1, "N/A", 242, 208, BackgroundColor, BackgroundColor, 16); if (!screenmute) tftPrint(-1, "N/A", 242, 208, BackgroundColor, BackgroundColor, 16);
if (!screenmute) tftPrint(-1, LIColdString, 242, 208, BackgroundColor, BackgroundColor, 16); if (!screenmute) tftPrint(-1, LIColdString, 242, 208, BackgroundColor, BackgroundColor, 16);
if (radio.rds.LIC > 0 && radio.rds.LIC < 171) { if (radio.rds.LIC > 0 && radio.rds.LIC < 128) {
if (!screenmute) { if (!screenmute) {
if (radio.rds.hasLIC) tftPrint(-1, myLanguages[radio.rds.LIC], 242, 208, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(-1, "N/A", 242, 208, PrimaryColor, PrimaryColorSmooth, 16); if (radio.rds.hasLIC) tftPrint(-1, myLanguages[radio.rds.LIC], 242, 208, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(-1, "N/A", 242, 208, PrimaryColor, PrimaryColorSmooth, 16);
} }
@@ -209,7 +209,7 @@ void ShowAdvancedRDS() {
if (afmethodBold != radio.afmethodB || rdsreset) { if (afmethodBold != radio.afmethodB || rdsreset) {
if (!screenmute) { if (!screenmute) {
if (radio.afmethodB) tftPrint(-1, "-R", 60, 51, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(-1, "-R", 60, 51, GreyoutColor, BackgroundColor, 16); if (radio.afmethodB) tftPrint(-1, "-B", 60, 51, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(-1, "-B", 60, 51, GreyoutColor, BackgroundColor, 16);
} }
afmethodBold = radio.afmethodB; afmethodBold = radio.afmethodB;
} }
@@ -829,12 +829,15 @@ void ShowAFEON() {
tft.fillRect(2, 48, 166, 150, BackgroundColor); tft.fillRect(2, 48, 166, 150, BackgroundColor);
for (byte i = 0; i < radio.af_counter; i++) { for (byte i = 0; i < radio.af_counter; i++) {
byte x = i - (afpagenr == 2 ? 30 : 0); byte x = i - (afpagenr == 2 ? 30 : 0);
if (radio.af[i].checked) { if (!screenmute) {
if (!screenmute) tftPrint(1, ((radio.afmethodB && radio.af[i].regional && radio.af[i].mixed) ? "M " : (radio.afmethodB && radio.af[i].regional && !radio.af[i].mixed ? "R " : "")) + String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 55 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), InsignificantColor, InsignificantColorSmooth, 16); tftPrint(-1, ((radio.afmethodB && !radio.af[i].regional && radio.af[i].mixed) ? "S " : (radio.afmethodB && radio.af[i].regional && radio.af[i].mixed) ? "M " : (radio.afmethodB && radio.af[i].regional && !radio.af[i].mixed) ? "R " : ""), 10 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), ActiveColor, ActiveColorSmooth, 16);
} else if (!radio.af[i].afvalid) { if (radio.af[i].checked) {
if (!screenmute) tftPrint(1, ((radio.afmethodB && radio.af[i].regional && radio.af[i].mixed) ? "M " : (radio.afmethodB && radio.af[i].regional && !radio.af[i].mixed ? "R " : "")) + String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 55 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), SignificantColor, SignificantColorSmooth, 16); tftPrint(1, String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 55 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), InsignificantColor, InsignificantColorSmooth, 16);
} else { } else if (!radio.af[i].afvalid) {
if (!screenmute) tftPrint(1, ((radio.afmethodB && radio.af[i].regional && radio.af[i].mixed) ? "M " : (radio.afmethodB && radio.af[i].regional && !radio.af[i].mixed ? "R " : "")) + String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 55 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), PrimaryColor, PrimaryColorSmooth, 16); tftPrint(1, String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 55 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), SignificantColor, SignificantColorSmooth, 16);
} else {
tftPrint(1, String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 55 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), PrimaryColor, PrimaryColorSmooth, 16);
}
} }
if (i == 29 + (afpagenr == 2 ? 30 : 0)) i = 254; if (i == 29 + (afpagenr == 2 ? 30 : 0)) i = 254;
} }