diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2021-11-15 20:46:28 +0100 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-11-18 16:44:21 -0500 |
commit | de0346065b415e03efad5746ffdee99d607a0d3c (patch) | |
tree | 87397e0435d5e9dcf03af7ef81c80a777e2f6fd1 /firmware/target/arm | |
parent | 701d4ba77e61984a71ddbf552193e5567be4e3af (diff) | |
download | rockbox-de0346065b415e03efad5746ffdee99d607a0d3c.tar.gz rockbox-de0346065b415e03efad5746ffdee99d607a0d3c.zip |
Sansa Clip+: add RDS support
Based on a patch by Amaury Pouly which was based on a patch from Ryan
Hitchman.
I mainly moved the code for polling into the tuner driver so it can be
reused by other targets. I added the CONFIG parameter for the polling
frequency (in ticks) to save energy. Also, I did some minor cleanups.
Change-Id: I95a62e7e1e42c62dbf47ecb27a3b312a42be62aa
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/as3525/fmradio-i2c-as3525.c | 6 | ||||
-rw-r--r-- | firmware/target/arm/as3525/system-as3525.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/fmradio-i2c-as3525.c b/firmware/target/arm/as3525/fmradio-i2c-as3525.c index 5b629f5ad4..7f6cb8366b 100644 --- a/firmware/target/arm/as3525/fmradio-i2c-as3525.c +++ b/firmware/target/arm/as3525/fmradio-i2c-as3525.c @@ -185,6 +185,11 @@ int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) } #ifdef HAVE_RDS_CAP +/* On the Sansa Clip Zip, the tuner interrupt line is routed to the SoC so we + * can use to detect when a RDS packet is ready. On the Clip+, we have to + * regularly poll. */ + +#if !(CONFIG_RDS & RDS_CFG_POLL) /* Low-level RDS Support */ static struct semaphore rds_sema; static uint32_t rds_stack[DEFAULT_STACK_SIZE/sizeof(uint32_t)]; @@ -231,4 +236,5 @@ void si4700_rds_init(void) create_thread(rds_thread, rds_stack, sizeof(rds_stack), 0, "rds" IF_PRIO(, PRIORITY_REALTIME) IF_COP(, CPU)); } +#endif /* !(CONFIG_RDS & RDS_CFG_POLL) */ #endif /* HAVE_RDS_CAP */ diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 83ccb55f79..0450c8b410 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c @@ -180,7 +180,7 @@ void INT_GPIOA(void) void button_gpioa_isr(void); button_gpioa_isr(); #endif -#ifdef HAVE_RDS_CAP +#if defined(HAVE_RDS_CAP) && !(CONFIG_RDS & RDS_CFG_POLL) void tuner_isr(void); tuner_isr(); #endif |