From f62388f82c1a3cbc5e47c8e002abb5a514e9251b Mon Sep 17 00:00:00 2001 From: Rob Purchase Date: Wed, 24 Jun 2009 07:37:11 +0000 Subject: 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 --- firmware/target/arm/tcc780x/kernel-tcc780x.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'firmware/target/arm/tcc780x/kernel-tcc780x.c') 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; + } +} -- cgit