Skip to content

Commit

Permalink
Add support for legacy RDS message
Browse files Browse the repository at this point in the history
  • Loading branch information
kkonradpl committed Jul 6, 2024
1 parent 6833952 commit b9d3653
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
/* ----------------------------------------------------------------------- */


Expand Down
7 changes: 7 additions & 0 deletions presets/tef-headless/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
/* ----------------------------------------------------------------------- */


Expand Down
10 changes: 10 additions & 0 deletions src/Controllers/Tuner/Tuner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Expand Down

0 comments on commit b9d3653

Please sign in to comment.