diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2017-11-04 19:27:36 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2017-11-04 19:28:40 +0100 |
commit | 8a925d283d12ab17a5d41f21fe6f7fecfa4af61b (patch) | |
tree | 1c6d7f3890e3e50411c8c767bdea6e3ad1ad9d56 | |
parent | d9a55ac8167a9bf9b7cb091ba49db59108a57d41 (diff) | |
download | rockbox-8a925d283d12ab17a5d41f21fe6f7fecfa4af61b.tar.gz rockbox-8a925d283d12ab17a5d41f21fe6f7fecfa4af61b.zip |
fuzep: fix rds
Change-Id: I15900f638f8f45cb7035a0e7b1caecb62d1d70e8
-rw-r--r-- | firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c index 5d146c4846..fb565dbdcf 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c +++ b/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c | |||
@@ -48,6 +48,14 @@ static void stc_rds_callback(int bank, int pin, intptr_t user) | |||
48 | semaphore_release(&rds_sema); | 48 | semaphore_release(&rds_sema); |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline void enable_rds_irq(void) | ||
52 | { | ||
53 | /* pin is set to low when a RDS packet has arrived, and stays low for a minimum of 5ms. Thus | ||
54 | * we should not trigger on low because otherwise we might trigger several times for the same | ||
55 | * message. Instead trigger on falling edge (we might miss the very first message). */ | ||
56 | imx233_pinctrl_setup_irq(2, 27, true, false, false, &stc_rds_callback, 0); | ||
57 | } | ||
58 | |||
51 | /* Captures RDS data and processes it */ | 59 | /* Captures RDS data and processes it */ |
52 | static void NORETURN_ATTR rds_thread(void) | 60 | static void NORETURN_ATTR rds_thread(void) |
53 | { | 61 | { |
@@ -57,7 +65,7 @@ static void NORETURN_ATTR rds_thread(void) | |||
57 | si4700_rds_process(); | 65 | si4700_rds_process(); |
58 | 66 | ||
59 | /* renable callback */ | 67 | /* renable callback */ |
60 | imx233_pinctrl_setup_irq(2, 27, true, true, false, &stc_rds_callback, 0); | 68 | enable_rds_irq(); |
61 | } | 69 | } |
62 | } | 70 | } |
63 | 71 | ||
@@ -69,8 +77,7 @@ void si4700_rds_powerup(bool on) | |||
69 | imx233_pinctrl_acquire(2, 27, "tuner stc/rds"); | 77 | imx233_pinctrl_acquire(2, 27, "tuner stc/rds"); |
70 | imx233_pinctrl_set_function(2, 27, PINCTRL_FUNCTION_GPIO); | 78 | imx233_pinctrl_set_function(2, 27, PINCTRL_FUNCTION_GPIO); |
71 | imx233_pinctrl_enable_gpio(2, 27, false); | 79 | imx233_pinctrl_enable_gpio(2, 27, false); |
72 | /* pin is set to 0 when an RDS packet has arrived */ | 80 | enable_rds_irq(); |
73 | imx233_pinctrl_setup_irq(2, 27, true, true, false, &stc_rds_callback, 0); | ||
74 | } | 81 | } |
75 | else | 82 | else |
76 | { | 83 | { |