1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Wolfram Sang 2021-11-15 20:46:28 +01:00 committed by Solomon Peachy
parent 701d4ba77e
commit de0346065b
6 changed files with 76 additions and 2 deletions

View file

@ -718,6 +718,7 @@ Lyre prototype 1 */
#define RDS_CFG_ISR 0x1 /* uses ISR to process packets */
#define RDS_CFG_PROCESS 0x2 /* uses raw packet processing */
#define RDS_CFG_PUSH 0x4 /* pushes processed information */
#define RDS_CFG_POLL 0x8 /* tuner driver provides a polling function */
#ifndef CONFIG_RDS
#define CONFIG_RDS RDS_CFG_PROCESS /* thread processing+raw processing */
#endif /* CONFIG_RDS */

View file

@ -17,6 +17,9 @@
#ifndef BOOTLOADER
#define HAVE_HOTSWAP
#define HAVE_RDS_CAP
#define CONFIG_RDS (RDS_CFG_POLL | RDS_CFG_PROCESS)
#define CONFIG_RDS_POLL_TICKS 4
#endif
#define HW_SAMPR_CAPS SAMPR_CAP_ALL_96
@ -146,6 +149,9 @@
/* define this if the flash memory uses the SecureDigital Memory Card protocol */
#define CONFIG_STORAGE STORAGE_SD
/* Define this if target has an additional number of threads specific to it */
#define TARGET_EXTRA_THREADS 1 /* RDS thread */
#define BATTERY_CAPACITY_DEFAULT 290 /* default battery capacity */
#define BATTERY_CAPACITY_MIN 290 /* min. capacity selectable */
#define BATTERY_CAPACITY_MAX 290 /* max. capacity selectable */

View file

@ -55,7 +55,13 @@ void si4700_rds_read_raw_async(unsigned char *buf, int count); /* implemented by
void si4700_rds_interrupt(void);
#endif /* (CONFIG_RDS & RDS_CFG_ISR) */
/* Read raw RDS info for processing */
/* Read raw RDS info for processing.
* - If RDS_CFG_ISR is set, the tuner driver will call si4700_rds_read_raw_async() which should
* perform an asynchronous read and call this function when the data has been read.
* - If RDS_CFG_POLL is set, this function will read status and RDS data and process it if a new
* packet is available.
* - Otherwise this function will read a RDS packet and process it under the assumption that it is
* new. */
void si4700_rds_process(void);
#endif /* HAVE_RDS_CAP */