summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/tcc780x/kernel-tcc780x.c
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2009-06-24 07:37:11 +0000
committerRob Purchase <shotofadds@rockbox.org>2009-06-24 07:37:11 +0000
commitf62388f82c1a3cbc5e47c8e002abb5a514e9251b (patch)
tree5fc6d6af526ca3ac3119104048b3c05cf185e191 /firmware/target/arm/tcc780x/kernel-tcc780x.c
parent5e24a2c98c9a7eb1b725c9bbb0233f9cf82004fb (diff)
downloadrockbox-f62388f82c1a3cbc5e47c8e002abb5a514e9251b.tar.gz
rockbox-f62388f82c1a3cbc5e47c8e002abb5a514e9251b.tar.bz2
rockbox-f62388f82c1a3cbc5e47c8e002abb5a514e9251b.zip
TCC78x: Enable interrupts/threading in the bootloader (required now that the storage driver yields).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21486 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/tcc780x/kernel-tcc780x.c')
-rw-r--r--firmware/target/arm/tcc780x/kernel-tcc780x.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/firmware/target/arm/tcc780x/kernel-tcc780x.c b/firmware/target/arm/tcc780x/kernel-tcc780x.c
index dee5e040e2..76395d2b33 100644
--- a/firmware/target/arm/tcc780x/kernel-tcc780x.c
+++ b/firmware/target/arm/tcc780x/kernel-tcc780x.c
@@ -38,5 +38,25 @@ void tick_start(unsigned int interval_in_ms)
TCFG(0) = TCFG_CLEAR | (0 << TCFG_SEL) | TCFG_IEN | TCFG_EN;
}
-/* NB: Since we are using a single timer IRQ, tick tasks are dispatched as
- part of the central timer IRQ processing in timer-tcc780x.c */
+
+/* Timer interrupt processing - all timers (inc. tick) share a single IRQ */
+void TIMER0(void)
+{
+ if (TIREQ & TIREQ_TF0) /* Timer0 reached ref value */
+ {
+ /* Run through the list of tick tasks */
+ call_tick_tasks();
+
+ /* reset Timer 0 IRQ & ref flags */
+ TIREQ = TIREQ_TI0 | TIREQ_TF0;
+ }
+
+ if (TIREQ & TIREQ_TF4) /* Timer4 reached ref value */
+ {
+ /* dispatch user timer */
+ if (pfn_timer != NULL)
+ pfn_timer();
+
+ TIREQ = TIREQ_TI4 | TIREQ_TF4;
+ }
+}