From d83e929f3fc369a5981e1e40e1c5307169a46cfc Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Thu, 12 Jan 2006 00:35:50 +0000 Subject: Work-in-progress iriver iFP-7xx port by Tomasz Malesinski git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8342 a1c6a512-1295-4272-9138-f99709370657 --- firmware/kernel.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'firmware/kernel.c') diff --git a/firmware/kernel.c b/firmware/kernel.c index a353c4bdc9..b30a3bb12b 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c @@ -358,6 +358,41 @@ void tick_start(unsigned int interval_in_ms) #endif } +#elif CONFIG_CPU == PNX0101 + +void timer_handler(void) +{ + int i; + + /* Run through the list of tick tasks */ + for(i = 0;i < MAX_NUM_TICK_TASKS;i++) + { + if(tick_funcs[i]) + tick_funcs[i](); + } + + current_tick++; + wake_up_thread(); + + TIMERR0C = 1; +} + +void tick_start(unsigned int interval_in_ms) +{ + TIMERR08 &= ~0x80; + TIMERR0C = 1; + TIMERR08 &= ~0x80; + TIMERR08 |= 0x40; + TIMERR00 = 3000000 * interval_in_ms / 1000; + TIMERR08 &= ~0xc; + TIMERR0C = 1; + + irq_set_int_handler(4, timer_handler); + irq_enable_int(4); + + TIMERR08 |= 0x80; +} + #endif int tick_add_task(void (*f)(void)) -- cgit v1.2.3