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
+15 -1
View File
@@ -528,9 +528,12 @@ void TEF6686::readRDS(byte showrdserrors)
//AF decoder
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;
afmethodBprobe = true;
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;
@@ -543,19 +546,24 @@ void TEF6686::readRDS(byte showrdserrors)
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 (afmethodBprobe) {
if (buffer1 == currentfreq && buffer0 > buffer1) {
for (int x = 0; x < af_counter; x++) {
if (af[x].frequency == buffer0 && !af[x].regional) {
if (!af[x].regional) {
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;
}
}
@@ -564,20 +572,25 @@ void TEF6686::readRDS(byte showrdserrors)
if (buffer0 == currentfreq && buffer0 > buffer1) {
for (int x = 0; x < af_counter; x++) {
if (af[x].frequency == buffer1 && !af[x].regional) {
if (!af[x].regional) {
af[x].regional = true;
af_updatecounter++;
}
break;
}
}
} else if (buffer0 == 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;
}
}
}
}
bool isValuePresent = false;
for (int i = 0; i < 50; i++) {
@@ -1077,6 +1090,7 @@ void TEF6686::clearRDS (bool fullsearchrds)
packet2 = false;
packet3 = false;
rds.aid_counter = 0;
afmethodBprobe = false;
}
void TEF6686::tone(uint16_t time, int16_t amplitude, uint16_t frequency) {
+1
View File
@@ -342,5 +342,6 @@ class TEF6686 {
bool packet1;
bool packet2;
bool packet3;
bool afmethodBprobe;
};
#endif
+1 -1
View File
@@ -648,7 +648,7 @@ void BuildAdvancedRDS() {
tftPrint(-1, "TP", 2, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "TA", 21, 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, "TMC", 95, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "RT+", 130, 51, GreyoutColor, BackgroundColor, 16);
+8 -5
View File
@@ -56,7 +56,7 @@ void ShowAdvancedRDS() {
if (!screenmute) tftPrint(-1, "N/A", 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 (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 (!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;
}
@@ -829,12 +829,15 @@ void ShowAFEON() {
tft.fillRect(2, 48, 166, 150, BackgroundColor);
for (byte i = 0; i < radio.af_counter; i++) {
byte x = i - (afpagenr == 2 ? 30 : 0);
if (!screenmute) {
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);
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), InsignificantColor, InsignificantColorSmooth, 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 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), 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), SignificantColor, SignificantColorSmooth, 16);
} else {
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), PrimaryColor, PrimaryColorSmooth, 16);
}
}
if (i == 29 + (afpagenr == 2 ? 30 : 0)) i = 254;
}