diff --git a/src/TEF6686.cpp b/src/TEF6686.cpp index 6d2e425..0e00c9d 100644 --- a/src/TEF6686.cpp +++ b/src/TEF6686.cpp @@ -1372,6 +1372,7 @@ void TEF6686::readRDS(byte showrdserrors) { RDScharConverter(ptyn_buffer, PTYNtext, sizeof(PTYNtext) / sizeof(wchar_t), false); // Convert 8 bit ASCII to 16 bit ASCII String utf8String = convertToUTF8(PTYNtext); // Convert RDS characterset to ASCII rds.PTYN = extractUTF8Substring(utf8String, 0, 8, false); // Make sure text is not longer than 8 chars + rds.hasPTYN = true; } } } break; @@ -1761,6 +1762,7 @@ void TEF6686::clearRDS (bool fullsearchrds) { rds.hasCT = false; rds.hasTMC = false; rds.hasAID = false; + rds.hasPTYN = false; rds.hasLongPS = false; rds.hasRDSplus = false; rds.hasDABAF = false; diff --git a/src/TEF6686.h b/src/TEF6686.h index dc6862a..c99d8ae 100644 --- a/src/TEF6686.h +++ b/src/TEF6686.h @@ -611,6 +611,7 @@ typedef struct _rds_ { bool hasTMC; bool hasAF; bool hasCT; + bool hasPTYN; bool rtAB; bool rtAB32; bool hasRDSplus; @@ -707,7 +708,7 @@ class TEF6686 { void setUnMute(); void setVolume(int8_t volume); void tone(uint16_t time, int16_t amplitude, uint16_t frequency); - String trimTrailingSpaces(String str); + String trimTrailingSpaces(String str); uint8_t af_counter; uint8_t eon_counter; uint8_t logbook_counter; diff --git a/src/rds.cpp b/src/rds.cpp index 4c5c55c..8041362 100644 --- a/src/rds.cpp +++ b/src/rds.cpp @@ -48,11 +48,11 @@ void ShowAdvancedRDS() { if (ptynold != radio.rds.PTYN || rdsreset) { if (!screenmute) { - if (ptynold != "PTYN N/A") { + if (ptynold != "PTYN N/A" || radio.rds.hasPTYN) { tftPrint(-1, "PTYN N/A", 216, 109, BackgroundColor, BackgroundColor, 16); tftPrint(-1, ptynold, 216, 109, BackgroundColor, BackgroundColor, 16); } - if (radio.rds.PTYN.length() == 0) radio.rds.PTYN = "PTYN N/A"; + if (!radio.rds.hasPTYN) radio.rds.PTYN = "PTYN N/A"; tftPrint(-1, String(radio.rds.PTYN), 216, 109, RDSColor, RDSColorSmooth, 16); ptynold = radio.rds.PTYN; }