AFEON page 2 now shows the next 10 EON's

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-10-12 15:22:54 +02:00
parent e16ffedbdc
commit 7878f1d093
+16 -14
View File
@@ -595,7 +595,7 @@ void readRds() {
tft.fillCircle(162, 41, 5, SignificantColor); tft.fillCircle(162, 41, 5, SignificantColor);
tft.fillCircle(200, 41, 5, SignificantColor); tft.fillCircle(200, 41, 5, SignificantColor);
} }
dropout = true; dropout = true;
} }
} else { } else {
if (dropout) { if (dropout) {
@@ -823,7 +823,7 @@ void ShowAFEON() {
hasafold = true; hasafold = true;
} }
if (radio.af_counter > 30) { if (radio.af_counter > 30 || radio.eon_counter > 10) {
if (!afpage) { if (!afpage) {
afpage = true; afpage = true;
afpagenr = 1; afpagenr = 1;
@@ -851,7 +851,7 @@ void ShowAFEON() {
if (afpage && !screenmute) tftPrint(1, String(afpagenr) + "/2", 315, 222, SecondaryColor, SecondaryColorSmooth, 16); if (afpage && !screenmute) tftPrint(1, String(afpagenr) + "/2", 315, 222, SecondaryColor, SecondaryColorSmooth, 16);
} }
af_counterold = radio.af_counter; af_counterold = radio.af_counter;
afmethodBold = radio.afmethodB; afmethodBold = radio.afmethodB;
} }
if (radio.rds.hasEON) { if (radio.rds.hasEON) {
@@ -861,24 +861,26 @@ void ShowAFEON() {
} }
haseonold = true; haseonold = true;
if (!screenmute) { if (!screenmute) {
byte y = 0;
if (afpagenr == 2) y = 10;
for (byte i = 0; i < radio.eon_counter; i++) { for (byte i = 0; i < radio.eon_counter; i++) {
tftPrint(-1, String(radio.eon[i].picode), 170, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16); tftPrint(-1, String(radio.eon[i + y].picode), 170, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16);
if (radio.eon[i].ps.length() > 0) { if (radio.eon[i + y].ps.length() > 0) {
tftPrint(-1, "PS:", 206, 32, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, "PS:", 206, 32, ActiveColor, ActiveColorSmooth, 16);
if (radio.eon[i].ps != eonpsold[i]) { if (radio.eon[i + y].ps != eonpsold[i + y]) {
tftPrint(-1, String(eonpsold[i]), 206, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); tftPrint(-1, String(eonpsold[i + y]), 206, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
eonpsold[i] = radio.eon[i].ps; eonpsold[i + y] = radio.eon[i + y].ps;
} }
tftPrint(-1, String(radio.eon[i].ps), 206, 48 + (15 * i), SecondaryColor, SecondaryColorSmooth, 16); tftPrint(-1, String(radio.eon[i + y].ps), 206, 48 + (15 * i), SecondaryColor, SecondaryColorSmooth, 16);
} }
if (radio.eon[i].mappedfreq > 0) { if (radio.eon[i + y].mappedfreq > 0) {
tftPrint(1, "FREQ:", 316, 32, ActiveColor, ActiveColorSmooth, 16); tftPrint(1, "FREQ:", 316, 32, ActiveColor, ActiveColorSmooth, 16);
if (radio.eon[i].mappedfreq != mappedfreqold[i]) { if (radio.eon[i + y].mappedfreq != mappedfreqold[i + y]) {
tftPrint(1, String(mappedfreqold[i] / 100) + "." + String((mappedfreqold[i] % 100) / 10), 316, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); tftPrint(1, String(mappedfreqold[i + y] / 100) + "." + String((mappedfreqold[i + y] % 100) / 10), 316, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
} }
tftPrint(1, String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10), 316, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16); tftPrint(1, String(radio.eon[i + y].mappedfreq / 100) + "." + String((radio.eon[i + y].mappedfreq % 100) / 10), 316, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16);
mappedfreqold[i] = radio.eon[i].mappedfreq; mappedfreqold[i + y] = radio.eon[i + y].mappedfreq;
} }
if (i == 10) i = 254; if (i == 10) i = 254;
} }