From 2403f38c1fd8bc35d4d8e4b12047265366fbf1b7 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 29 Dec 2011 14:55:49 +0000 Subject: RDS: Use a define that doesn't imply any particular hardware dependency. Theoretically, anything with the capability could implement the decoding action in an ISR on any radio chip supporting RDS. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31464 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/tuner/si4700.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'firmware/drivers/tuner/si4700.c') diff --git a/firmware/drivers/tuner/si4700.c b/firmware/drivers/tuner/si4700.c index 0684d2042f..917f628490 100644 --- a/firmware/drivers/tuner/si4700.c +++ b/firmware/drivers/tuner/si4700.c @@ -21,9 +21,8 @@ * ****************************************************************************/ #include "config.h" -#include +#include "system.h" #include -#include #include "kernel.h" #include "power.h" #include "tuner.h" /* tuner abstraction interface */ @@ -529,9 +528,17 @@ int si4700_get(int setting) #ifdef HAVE_RDS_CAP case RADIO_EVENT: + { + #ifdef RDS_ISR_PROCESSING + int oldlevel = disable_irq_save(); + #endif val = rds_event; rds_event = 0; + #ifdef RDS_ISR_PROCESSING + restore_irq(oldlevel); + #endif break; + } #endif } @@ -557,8 +564,8 @@ void si4700_dbg_info(struct si4700_dbg_info *nfo) #ifdef HAVE_RDS_CAP -#ifdef SI4700_RDS_ASYNC -/* Read raw RDS info for processing - asynchronously */ +#ifdef RDS_ISR_PROCESSING +/* Read raw RDS info for processing - in ISR */ /* Assumes regbuf is 32 bytes */ void si4700_rds_read_raw_async(void) @@ -583,7 +590,7 @@ void si4700_rds_set_event(void) rds_event = 1; } -#else +#else /* ndef RDS_ISR_PROCESSING */ /* Read raw RDS info for processing */ bool si4700_rds_read_raw(uint16_t data[4]) { @@ -610,7 +617,7 @@ void si4700_rds_set_event(void) rds_event = 1; mutex_unlock(&fmr_mutex); } -#endif /* SI4700_RDS_ASYNC */ +#endif /* RDS_ISR_PROCESSING */ char * si4700_get_rds_info(int setting) { -- cgit v1.2.3