diff --git a/Config.hpp b/Config.hpp index 16560a2..61140a9 100644 --- a/Config.hpp +++ b/Config.hpp @@ -12,6 +12,13 @@ /* Enable only on Arduino boards modified to 3.3V operation For 5V boards use external 10 kΩ pull-ups from SDA and SCL to 3.3V */ #define TUNER_AVR_PULLUP false + +/* Legacy RDS message (R) in the communication protocol */ +/* Keep enabled for pre-v1.2 XDR-GTK compability. New message additionaly + contains the first block (PI code), which is useful for direct + passthrough to RDS Spy. When using the legacy message, the first block + is reconstructed from the buffered PI code message (P) for RDS Spy. */ +#define TUNER_LEGACY_RDS_MSG true /* ----------------------------------------------------------------------- */ diff --git a/presets/tef-headless/Config.hpp b/presets/tef-headless/Config.hpp index 4637172..b803d5f 100644 --- a/presets/tef-headless/Config.hpp +++ b/presets/tef-headless/Config.hpp @@ -12,6 +12,13 @@ /* Enable only on Arduino boards modified to 3.3V operation For 5V boards use external 10 kΩ pull-ups from SDA and SCL to 3.3V */ #define TUNER_AVR_PULLUP false + +/* Legacy RDS message (R) in the communication protocol */ +/* Keep enabled for pre-v1.2 XDR-GTK compability. New message additionaly + contains the first block (PI code), which is useful for direct + passthrough to RDS Spy. When using the legacy message, the first block + is reconstructed from the buffered PI code message (P) for RDS Spy. */ +#define TUNER_LEGACY_RDS_MSG true /* ----------------------------------------------------------------------- */ diff --git a/src/Controllers/Tuner/Tuner.cpp b/src/Controllers/Tuner/Tuner.cpp index b9d8161..e1e9579 100644 --- a/src/Controllers/Tuner/Tuner.cpp +++ b/src/Controllers/Tuner/Tuner.cpp @@ -168,11 +168,21 @@ Tuner::handleRds() if (this->driver.rdsBuffer.get(&rdsData, &rdsStatus)) { Comm.print('R'); +#if TUNER_LEGACY_RDS_MSG == false Utils::serialHex16(rdsData[0]); +#endif Utils::serialHex16(rdsData[1]); Utils::serialHex16(rdsData[2]); Utils::serialHex16(rdsData[3]); +#if TUNER_LEGACY_RDS_MSG == false Utils::serialHex8(rdsStatus); +#else + uint8_t legacyStatus = 0; + legacyStatus |= (rdsStatus & B00110000) >> 4; + legacyStatus |= (rdsStatus & B00001100); + legacyStatus |= (rdsStatus & B00000011) << 4; + Utils::serialHex8(legacyStatus); +#endif Comm.print('\n'); } }