summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/timrot-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-09-06 00:27:38 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-09-06 00:27:38 +0000
commit2ac668e44cec12616a4d675f8eade8049ed10af9 (patch)
tree946451d3ef42a2e1f7c3259b81344ffb82ce041b /firmware/target/arm/imx233/timrot-imx233.c
parent333b9ed2c330bb005456444de0eb16ad422496fa (diff)
downloadrockbox-2ac668e44cec12616a4d675f8eade8049ed10af9.tar.gz
rockbox-2ac668e44cec12616a4d675f8eade8049ed10af9.tar.bz2
rockbox-2ac668e44cec12616a4d675f8eade8049ed10af9.zip
imx233/fuze+: implement user time api, implement a stub function, protect timrot against irq
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30437 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx233/timrot-imx233.c')
-rw-r--r--firmware/target/arm/imx233/timrot-imx233.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/timrot-imx233.c b/firmware/target/arm/imx233/timrot-imx233.c
index 64a7c63f24..b2a1181ece 100644
--- a/firmware/target/arm/imx233/timrot-imx233.c
+++ b/firmware/target/arm/imx233/timrot-imx233.c
@@ -39,6 +39,8 @@ define_timer_irq(3)
void imx233_setup_timer(unsigned timer_nr, bool reload, unsigned count,
unsigned src, unsigned prescale, bool polarity, imx233_timer_fn_t fn)
{
+ int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS);
+
timer_fns[timer_nr] = fn;
HW_TIMROT_TIMCTRL(timer_nr) = src | prescale;
@@ -65,6 +67,8 @@ void imx233_setup_timer(unsigned timer_nr, bool reload, unsigned count,
imx233_enable_interrupt(INT_SRC_TIMER(timer_nr), false);
/* finally update */
__REG_SET(HW_TIMROT_TIMCTRL(timer_nr)) = HW_TIMROT_TIMCTRL__UPDATE;
+
+ restore_interrupt(oldstatus);
}
void imx233_timrot_init(void)