forked from len0rd/rockbox
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
This commit is contained in:
parent
d6eefbb219
commit
4ffa052297
1 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue