diff options
-rw-r--r-- | firmware/drivers/rds.c | 6 | ||||
-rw-r--r-- | firmware/drivers/tuner/si4700.c | 19 | ||||
-rw-r--r-- | firmware/export/config/gigabeats.h | 2 | ||||
-rw-r--r-- | firmware/export/si4700.h | 8 |
4 files changed, 21 insertions, 14 deletions
diff --git a/firmware/drivers/rds.c b/firmware/drivers/rds.c index 828c28b672..05b17aba12 100644 --- a/firmware/drivers/rds.c +++ b/firmware/drivers/rds.c | |||
@@ -36,7 +36,7 @@ static char rt_copy[65]; | |||
36 | static int rt_segment; | 36 | static int rt_segment; |
37 | static int rt_abflag; | 37 | static int rt_abflag; |
38 | 38 | ||
39 | #ifdef SI4700_RDS_ASYNC | 39 | #ifdef RDS_ISR_PROCESSING |
40 | /* Functions are called in ISR context */ | 40 | /* Functions are called in ISR context */ |
41 | #define rds_disable_irq_save() disable_irq_save() | 41 | #define rds_disable_irq_save() disable_irq_save() |
42 | #define rds_restore_irq(old) restore_irq(old) | 42 | #define rds_restore_irq(old) restore_irq(old) |
@@ -57,12 +57,12 @@ static inline char * get_rt(void) | |||
57 | rds_restore_irq(oldlevel); | 57 | rds_restore_irq(oldlevel); |
58 | return rt_out; | 58 | return rt_out; |
59 | } | 59 | } |
60 | #else /* ndef SI4700_RDS_ASYNC */ | 60 | #else /* ndef RDS_ISR_PROCESSING */ |
61 | #define rds_disable_irq_save() 0 | 61 | #define rds_disable_irq_save() 0 |
62 | #define rds_restore_irq(old) ((void)(old)) | 62 | #define rds_restore_irq(old) ((void)(old)) |
63 | static inline char * get_ps(void) { return ps_copy; } | 63 | static inline char * get_ps(void) { return ps_copy; } |
64 | static inline char * get_rt(void) { return rt_copy; } | 64 | static inline char * get_rt(void) { return rt_copy; } |
65 | #endif /* SI4700_RDS_ASYNC */ | 65 | #endif /* RDS_ISR_PROCESSING */ |
66 | 66 | ||
67 | /* resets the rds parser */ | 67 | /* resets the rds parser */ |
68 | void rds_reset(void) | 68 | void rds_reset(void) |
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 @@ | |||
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include <stdbool.h> | 24 | #include "system.h" |
25 | #include <string.h> | 25 | #include <string.h> |
26 | #include <stdlib.h> | ||
27 | #include "kernel.h" | 26 | #include "kernel.h" |
28 | #include "power.h" | 27 | #include "power.h" |
29 | #include "tuner.h" /* tuner abstraction interface */ | 28 | #include "tuner.h" /* tuner abstraction interface */ |
@@ -529,9 +528,17 @@ int si4700_get(int setting) | |||
529 | 528 | ||
530 | #ifdef HAVE_RDS_CAP | 529 | #ifdef HAVE_RDS_CAP |
531 | case RADIO_EVENT: | 530 | case RADIO_EVENT: |
531 | { | ||
532 | #ifdef RDS_ISR_PROCESSING | ||
533 | int oldlevel = disable_irq_save(); | ||
534 | #endif | ||
532 | val = rds_event; | 535 | val = rds_event; |
533 | rds_event = 0; | 536 | rds_event = 0; |
537 | #ifdef RDS_ISR_PROCESSING | ||
538 | restore_irq(oldlevel); | ||
539 | #endif | ||
534 | break; | 540 | break; |
541 | } | ||
535 | #endif | 542 | #endif |
536 | } | 543 | } |
537 | 544 | ||
@@ -557,8 +564,8 @@ void si4700_dbg_info(struct si4700_dbg_info *nfo) | |||
557 | 564 | ||
558 | #ifdef HAVE_RDS_CAP | 565 | #ifdef HAVE_RDS_CAP |
559 | 566 | ||
560 | #ifdef SI4700_RDS_ASYNC | 567 | #ifdef RDS_ISR_PROCESSING |
561 | /* Read raw RDS info for processing - asynchronously */ | 568 | /* Read raw RDS info for processing - in ISR */ |
562 | 569 | ||
563 | /* Assumes regbuf is 32 bytes */ | 570 | /* Assumes regbuf is 32 bytes */ |
564 | void si4700_rds_read_raw_async(void) | 571 | void si4700_rds_read_raw_async(void) |
@@ -583,7 +590,7 @@ void si4700_rds_set_event(void) | |||
583 | rds_event = 1; | 590 | rds_event = 1; |
584 | } | 591 | } |
585 | 592 | ||
586 | #else | 593 | #else /* ndef RDS_ISR_PROCESSING */ |
587 | /* Read raw RDS info for processing */ | 594 | /* Read raw RDS info for processing */ |
588 | bool si4700_rds_read_raw(uint16_t data[4]) | 595 | bool si4700_rds_read_raw(uint16_t data[4]) |
589 | { | 596 | { |
@@ -610,7 +617,7 @@ void si4700_rds_set_event(void) | |||
610 | rds_event = 1; | 617 | rds_event = 1; |
611 | mutex_unlock(&fmr_mutex); | 618 | mutex_unlock(&fmr_mutex); |
612 | } | 619 | } |
613 | #endif /* SI4700_RDS_ASYNC */ | 620 | #endif /* RDS_ISR_PROCESSING */ |
614 | 621 | ||
615 | char * si4700_get_rds_info(int setting) | 622 | char * si4700_get_rds_info(int setting) |
616 | { | 623 | { |
diff --git a/firmware/export/config/gigabeats.h b/firmware/export/config/gigabeats.h index 9a34791ab1..481a666b4b 100644 --- a/firmware/export/config/gigabeats.h +++ b/firmware/export/config/gigabeats.h | |||
@@ -90,7 +90,7 @@ | |||
90 | #define CONFIG_TUNER SI4700 | 90 | #define CONFIG_TUNER SI4700 |
91 | 91 | ||
92 | #define HAVE_RDS_CAP | 92 | #define HAVE_RDS_CAP |
93 | #define SI4700_RDS_ASYNC | 93 | #define RDS_ISR_PROCESSING |
94 | 94 | ||
95 | /* Define this if you have the WM8978 audio codec */ | 95 | /* Define this if you have the WM8978 audio codec */ |
96 | #define HAVE_WM8978 | 96 | #define HAVE_WM8978 |
diff --git a/firmware/export/si4700.h b/firmware/export/si4700.h index fe55dd3853..6b7992c025 100644 --- a/firmware/export/si4700.h +++ b/firmware/export/si4700.h | |||
@@ -46,16 +46,16 @@ bool si4700_st(void); | |||
46 | void si4700_rds_init(void); | 46 | void si4700_rds_init(void); |
47 | /* Radio is fully powered up or about to be powered down */ | 47 | /* Radio is fully powered up or about to be powered down */ |
48 | void si4700_rds_powerup(bool on); | 48 | void si4700_rds_powerup(bool on); |
49 | #ifdef SI4700_RDS_ASYNC | 49 | #ifdef RDS_ISR_PROCESSING |
50 | /* Read raw RDS info for processing - asynchronously */ | 50 | /* Read raw RDS info for processing - asynchronously */ |
51 | void si4700_read_raw_async(int count); | 51 | void si4700_read_raw_async(int count); /* implemented by target */ |
52 | void si4700_rds_read_raw_async(void); | 52 | void si4700_rds_read_raw_async(void); |
53 | void si4700_rds_read_raw_async_complete(unsigned char *regbuf, | 53 | void si4700_rds_read_raw_async_complete(unsigned char *regbuf, |
54 | uint16_t data[4]); | 54 | uint16_t data[4]); |
55 | #else | 55 | #else /* ndef RDS_ISR_PROCESSING */ |
56 | /* Read raw RDS info for processing */ | 56 | /* Read raw RDS info for processing */ |
57 | bool si4700_rds_read_raw(uint16_t data[4]); | 57 | bool si4700_rds_read_raw(uint16_t data[4]); |
58 | #endif | 58 | #endif /* RDS_ISR_PROCESSING */ |
59 | /* Obtain specified string */ | 59 | /* Obtain specified string */ |
60 | char* si4700_get_rds_info(int setting); | 60 | char* si4700_get_rds_info(int setting); |
61 | /* Set the event flag */ | 61 | /* Set the event flag */ |