From 5d86568f486c1853925bfa78e9d352e019922957 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Tue, 7 Nov 2023 12:33:52 +0100 Subject: [PATCH] Fix flashing PI in USA mode while searching callsign in database --- src/TEF6686.cpp | 3 --- src/TEF6686.h | 1 - src/rds.cpp | 6 +++--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/TEF6686.cpp b/src/TEF6686.cpp index 7ebd326..ade8482 100644 --- a/src/TEF6686.cpp +++ b/src/TEF6686.cpp @@ -407,14 +407,12 @@ void TEF6686::readRDS(byte showrdserrors) rds.picode[i] += 'A' - 10; // Add ASCII offset for hexadecimal letters A-F } } - rds.picodetext = rds.picode; } if (!rdsAerrorThreshold && !rdsBerrorThreshold && !rdsCerrorThreshold && !rdsDerrorThreshold) { rds.picode[4] = ' '; rds.picode[5] = ' '; errorfreepi = true; - rds.picodetext = rds.picode; } if (!errorfreepi) { @@ -1435,7 +1433,6 @@ void TEF6686::clearRDS (bool fullsearchrds) { rds.PTYN = ""; rds.ECCtext = ""; rds.LICtext = ""; - rds.picodetext = ""; rds.stationIDtext = ""; rds.stationStatetext = ""; diff --git a/src/TEF6686.h b/src/TEF6686.h index ac7ac70..ba8c95f 100644 --- a/src/TEF6686.h +++ b/src/TEF6686.h @@ -560,7 +560,6 @@ typedef struct _rds_ { String PTYN; String ECCtext; String LICtext; - String picodetext; String stationIDtext; String stationStatetext; char stationType[18]; diff --git a/src/rds.cpp b/src/rds.cpp index b6a5d5b..4df988b 100644 --- a/src/rds.cpp +++ b/src/rds.cpp @@ -396,13 +396,13 @@ void readRds() { } void showPI() { - if ((region == REGION_US && (radio.rds.picodetext != PIold || radio.rds.stationIDtext != stationIDold || radio.rds.stationStatetext != stationStateold)) || (region != REGION_US && radio.rds.picodetext != PIold)) { + 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 (!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 (!screenmute) { if (advancedRDS) { if (region == REGION_EU) tftReplace(0, PIold, radio.rds.picode, 275, 75, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_US) { - tftReplace(-1, PIold, radio.rds.picode, 240, 72, PrimaryColor, PrimaryColorSmooth, 16); + if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 72, PrimaryColor, PrimaryColorSmooth, 16); tftReplace(-1, stationIDold, radio.rds.stationID, 240, 89, PrimaryColor, PrimaryColorSmooth, 16); tftReplace(1, stationStateold, radio.rds.stationState, 318, 89, SecondaryColor, SecondaryColorSmooth, 16); } @@ -411,7 +411,7 @@ void showPI() { } else { if (region == REGION_EU) tftReplace(0, PIold, radio.rds.picode, 275, 187, PrimaryColor, PrimaryColorSmooth, 28); if (region == REGION_US) { - tftReplace(-1, PIold, radio.rds.picode, 240, 184, PrimaryColor, PrimaryColorSmooth, 16); + if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 184, PrimaryColor, PrimaryColorSmooth, 16); tftReplace(-1, stationIDold, radio.rds.stationID, 240, 201, PrimaryColor, PrimaryColorSmooth, 16); tftReplace(1, stationStateold, radio.rds.stationState, 318, 201, SecondaryColor, SecondaryColorSmooth, 16); }