summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-11-04 19:27:36 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2017-11-04 19:28:40 +0100
commit8a925d283d12ab17a5d41f21fe6f7fecfa4af61b (patch)
tree1c6d7f3890e3e50411c8c767bdea6e3ad1ad9d56
parentd9a55ac8167a9bf9b7cb091ba49db59108a57d41 (diff)
downloadrockbox-8a925d283d12ab17a5d41f21fe6f7fecfa4af61b.tar.gz
rockbox-8a925d283d12ab17a5d41f21fe6f7fecfa4af61b.zip
fuzep: fix rds
Change-Id: I15900f638f8f45cb7035a0e7b1caecb62d1d70e8
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c13
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)
semaphore_release(&rds_sema);
}
+static inline void enable_rds_irq(void)
+{
+ /* pin is set to low when a RDS packet has arrived, and stays low for a minimum of 5ms. Thus
+ * we should not trigger on low because otherwise we might trigger several times for the same
+ * message. Instead trigger on falling edge (we might miss the very first message). */
+ imx233_pinctrl_setup_irq(2, 27, true, false, false, &stc_rds_callback, 0);
+}
+
/* Captures RDS data and processes it */
static void NORETURN_ATTR rds_thread(void)
{
@@ -57,7 +65,7 @@ static void NORETURN_ATTR rds_thread(void)
si4700_rds_process();
/* renable callback */
- imx233_pinctrl_setup_irq(2, 27, true, true, false, &stc_rds_callback, 0);
+ enable_rds_irq();
}
}
@@ -69,8 +77,7 @@ void si4700_rds_powerup(bool on)
imx233_pinctrl_acquire(2, 27, "tuner stc/rds");
imx233_pinctrl_set_function(2, 27, PINCTRL_FUNCTION_GPIO);
imx233_pinctrl_enable_gpio(2, 27, false);
- /* pin is set to 0 when an RDS packet has arrived */
- imx233_pinctrl_setup_irq(2, 27, true, true, false, &stc_rds_callback, 0);
+ enable_rds_irq();
}
else
{