diff options
Diffstat (limited to 'firmware/target/arm/tcc780x/kernel-tcc780x.c')
-rw-r--r-- | firmware/target/arm/tcc780x/kernel-tcc780x.c | 24 |
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) | |||
38 | TCFG(0) = TCFG_CLEAR | (0 << TCFG_SEL) | TCFG_IEN | TCFG_EN; | 38 | TCFG(0) = TCFG_CLEAR | (0 << TCFG_SEL) | TCFG_IEN | TCFG_EN; |
39 | } | 39 | } |
40 | 40 | ||
41 | /* NB: Since we are using a single timer IRQ, tick tasks are dispatched as | 41 | |
42 | part of the central timer IRQ processing in timer-tcc780x.c */ | 42 | /* Timer interrupt processing - all timers (inc. tick) share a single IRQ */ |
43 | void TIMER0(void) | ||
44 | { | ||
45 | if (TIREQ & TIREQ_TF0) /* Timer0 reached ref value */ | ||
46 | { | ||
47 | /* Run through the list of tick tasks */ | ||
48 | call_tick_tasks(); | ||
49 | |||
50 | /* reset Timer 0 IRQ & ref flags */ | ||
51 | TIREQ = TIREQ_TI0 | TIREQ_TF0; | ||
52 | } | ||
53 | |||
54 | if (TIREQ & TIREQ_TF4) /* Timer4 reached ref value */ | ||
55 | { | ||
56 | /* dispatch user timer */ | ||
57 | if (pfn_timer != NULL) | ||
58 | pfn_timer(); | ||
59 | |||
60 | TIREQ = TIREQ_TI4 | TIREQ_TF4; | ||
61 | } | ||
62 | } | ||