diff options
| author | Tomasz Malesinski <tomal@rockbox.org> | 2007-03-24 19:26:13 +0000 |
|---|---|---|
| committer | Tomasz Malesinski <tomal@rockbox.org> | 2007-03-24 19:26:13 +0000 |
| commit | cd630c9e0a2e0aa259a6e53a5af1369f36984b1c (patch) | |
| tree | 84bff67d18b47884f1a777eabfb7ba3de7d35c14 /firmware/kernel.c | |
| parent | 7d9ff93b79ef66333669e01d67c7b1736370a346 (diff) | |
| download | rockbox-cd630c9e0a2e0aa259a6e53a5af1369f36984b1c.zip rockbox-cd630c9e0a2e0aa259a6e53a5af1369f36984b1c.tar.gz rockbox-cd630c9e0a2e0aa259a6e53a5af1369f36984b1c.tar.bz2 rockbox-cd630c9e0a2e0aa259a6e53a5af1369f36984b1c.tar.xz | |
PNX0101 changes:
Make PNX0101-specific system.c and crt0.S.
Add new register names from LPC2880 user manual.
Add support for timer.
Enable CPU frequency changing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12904 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/kernel.c')
| -rw-r--r-- | firmware/kernel.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c index 192728b..c5e47a8 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c @@ -594,23 +594,21 @@ void timer_handler(void) current_tick++; - TIMERR0C = 1; + TIMER0.clr = 0; } 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; + TIMER0.ctrl &= ~0x80; /* Disable the counter */ + TIMER0.ctrl |= 0x40; /* Reload after counting down to zero */ + TIMER0.load = 3000000 * interval_in_ms / 1000; + TIMER0.ctrl &= ~0xc; /* No prescaler */ + TIMER0.clr = 1; /* Clear the interrupt request */ - irq_set_int_handler(4, timer_handler); - irq_enable_int(4); + irq_set_int_handler(IRQ_TIMER0, timer_handler); + irq_enable_int(IRQ_TIMER0); - TIMERR08 |= 0x80; + TIMER0.ctrl |= 0x80; /* Enable the counter */ } #elif CONFIG_CPU == S3C2440 void tick_start(unsigned int interval_in_ms) |