summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-04-19 23:20:00 -0400
committerMichael Sevakis <jethead71@rockbox.org>2017-04-19 23:20:00 -0400
commit4ffa052297ebdd9c8bbf7a8961dd8b0312d60d0f (patch)
treee709127fcc887a77a14326290084343a705d294f
parentd6eefbb21959f690d2da703a7ca421ac5be9c5fa (diff)
downloadrockbox-4ffa052.tar.gz
rockbox-4ffa052.zip
RDS on Samsung YPR0: Make compatible with RDS changes
si4700_rds_process() should only be called on the rising edge of RDSR since it now rejects segments out of sequence. Receiving the same segment multiple times due to rapid polling is of course out of sequence so do no more processing until RDSR bit cycles to avoid repeatedly sending the same data instance. I don't have the tools installed to test compile so there could be typos. However, I tested on gigabeat-s with YPR0 setup copied over and it fixed the issue with PS and RT. Change-Id: Iab511bef64030de8c07d4d22dcf338c8720e2ae2
-rw-r--r--firmware/target/hosted/samsungypr/radio-ypr.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/firmware/target/hosted/samsungypr/radio-ypr.c b/firmware/target/hosted/samsungypr/radio-ypr.c
index af49c4c3f2..4fccf2616f 100644
--- a/firmware/target/hosted/samsungypr/radio-ypr.c
+++ b/firmware/target/hosted/samsungypr/radio-ypr.c
@@ -88,6 +88,7 @@ static void NORETURN_ATTR rds_thread(void)
/* start up frozen */
int timeout = TIMEOUT_BLOCK;
struct queue_event ev;
+ bool rds_rdy = false;
while (true) {
queue_wait_w_tmo(&rds_queue, &ev, timeout);
@@ -96,10 +97,14 @@ static void NORETURN_ATTR rds_thread(void)
/* power up: timeout after 1 tick, else block indefinitely */
timeout = ev.data ? 1 : TIMEOUT_BLOCK;
break;
- case SYS_TIMEOUT:
+ case SYS_TIMEOUT:;
/* Captures RDS data and processes it */
- if ((si4709_read_reg(STATUSRSSI) & STATUSRSSI_RDSR) >> 8) {
- si4700_rds_process();
+ bool rdsr = si4709_read_reg(STATUSRSSI) & STATUSRSSI_RDSR;
+ if (rdsr != rds_rdy) {
+ rds_rdy = rdsr;
+ if (rdsr) {
+ si4700_rds_process();
+ }
}
break;
}