diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 5baa7cb..011773b 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -263,6 +263,7 @@ String PTYold; String rds_clock; String rds_clockold; String RDSSPYRDS; +String RDSSPYRDSold; String RTold; String rtplusstringold; String salt; @@ -271,6 +272,7 @@ String SWMIBandstring = String(); String SWMIBandstringold = String(); String XDRGTK_key; String XDRGTKRDS; +String XDRGTKRDSold; uint16_t BW; uint16_t MStatus; uint16_t SWMIBandPos; diff --git a/src/TEF6686.cpp b/src/TEF6686.cpp index 4ab332f..bb4be63 100644 --- a/src/TEF6686.cpp +++ b/src/TEF6686.cpp @@ -773,10 +773,12 @@ void TEF6686::readRDS(byte showrdserrors) } if (togglebit) { - for (int i = 0; i < 45; i++) { - RDSplus1[i] = 0; - RDSplus2[i] = 0; + for (int i = 0; i < 44; i++) { + RDSplus1[i] = 0x20; + RDSplus2[i] = 0x20; } + RDSplus1[44] = 0; + RDSplus2[44] = 0; } if (rds.rtAB == rtABold) { @@ -888,16 +890,25 @@ void TEF6686::clearRDS (bool fullsearchrds) rds.RTContent2 = ""; rds.PTYN = ""; - for (i = 0; i < 9; i++) { - ps_buffer[i] = 0; + for (i = 0; i < 8; i++) { + ps_buffer[i] = 0x20; PStext[i] = L'\0'; - ptyn_buffer[i] = 0; + ptyn_buffer[i] = 0x20; PTYNtext[i] = L'\0'; } - for (i = 0; i < 65; i++) rt_buffer[i] = 0; - for (i = 0; i < 33; i++) rt_buffer32[i] = 0; - for (i = 0; i < 18; i++) rds.stationType[i] = 0; - for (i = 0; i < 6; i++) rds.picode[i] = 0; + ps_buffer[8] = 0; + ptyn_buffer[8] = 0; + PStext[8] = L'\0'; + PTYNtext[8] = L'\0'; + + for (i = 0; i < 64; i++) rt_buffer[i] = 0x20; + rt_buffer[64] = 0; + for (i = 0; i < 32; i++) rt_buffer32[i] = 0x20; + rt_buffer32[32] = 0; + for (i = 0; i < 17; i++) rds.stationType[i] = 0x20; + rds.stationType[17] = 0; + for (i = 0; i < 6; i++) rds.picode[i] = 0x20; + rds.picode[6] = 0; for (i = 0; i < 50; i++) { af[i].frequency = 0; diff --git a/src/rds.cpp b/src/rds.cpp index 93c5838..1d9959d 100644 --- a/src/rds.cpp +++ b/src/rds.cpp @@ -626,8 +626,9 @@ void readRds() { if (radio.rds.rdsDerror) RDSSPYRDS += "----"; else RDSSPYRDS += String(((radio.rds.rdsD >> 8) >> 4) & 0xF, HEX) + String((radio.rds.rdsD >> 8) & 0xF, HEX) + String(((radio.rds.rdsD) >> 4) & 0xF, HEX) + String((radio.rds.rdsD) & 0xF, HEX); RDSSPYRDS += "\r\n\r\n"; - if (bitRead(radio.rds.rdsStat, 9)) { + if (RDSSPYRDS != RDSSPYRDSold) { if (RDSSPYUSB) Serial.print(RDSSPYRDS); else RemoteClient.print(RDSSPYRDS); + RDSSPYRDSold = RDSSPYRDS; } } @@ -661,8 +662,9 @@ void readRds() { XDRGTKRDS += String(erroutput, HEX); XDRGTKRDS += "\n"; - if (bitRead(radio.rds.rdsStat, 9)) { + if (XDRGTKRDS != XDRGTKRDSold) { DataPrint(XDRGTKRDS); + XDRGTKRDSold = XDRGTKRDS; } } } diff --git a/src/rds.h b/src/rds.h index 1a69e6c..c382932 100644 --- a/src/rds.h +++ b/src/rds.h @@ -82,9 +82,11 @@ extern String PTYold; extern String rds_clock; extern String rds_clockold; extern String RDSSPYRDS; +extern String RDSSPYRDSold; extern String RTold; extern String rtplusstringold; extern String XDRGTKRDS; +extern String XDRGTKRDSold; extern unsigned int mappedfreqold[20]; extern unsigned long afticker; extern unsigned long aftickerhold;