From 419db542d94e0c4614df647a04b11510c7b103e3 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Thu, 24 Oct 2024 19:19:23 +0200 Subject: [PATCH] Fixed a problem showing over 10 EON's and fixed PTY in EON viewer --- src/rds.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/rds.cpp b/src/rds.cpp index 729720c..78bf1c7 100644 --- a/src/rds.cpp +++ b/src/rds.cpp @@ -927,7 +927,15 @@ void ShowAFEON() { byte y = 0; if (afpagenr == 3) y = 10; - for (byte i = 0; i < radio.eon_counter; i++) { + byte eon_numbers; + if (afpagenr != 3) { + if (radio.eon_counter > 9) eon_numbers = 10; else eon_numbers = radio.eon_counter; + } else { + eon_numbers = radio.eon_counter - 10; + } + + + for (byte i = 0; i < eon_numbers; i++) { if (eonpicodeold[i + y] == nullptr) { strcpy(eonpicodeold[i + y], ""); } @@ -1014,7 +1022,7 @@ void ShowAFEON() { } if (radio.eon[i + y].pty > 0) { - tftPrint(1, String(radio.eon[i + y].pty), 304, 48 + (15 * i), RDSColor, RDSColorSmooth, 16); + if (radio.eon[i + y].pty != 254) tftPrint(1, String(radio.eon[i + y].pty), 304, 48 + (15 * i), RDSColor, RDSColorSmooth, 16); eonptyold[i + y] = radio.eon[i + y].pty; } else { tftPrint(-1, String(eonptyold[i + y]), 304, 48 + (15 * i), BackgroundColor, BackgroundColor, 16); @@ -1028,4 +1036,4 @@ void ShowAFEON() { } } -#pragma GCC diagnostic pop +#pragma GCC diagnostic pop \ No newline at end of file