summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/tcc780x/kernel-tcc780x.c
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2009-03-30 21:15:15 +0000
committerRob Purchase <shotofadds@rockbox.org>2009-03-30 21:15:15 +0000
commit75b37696fba2e0c5c1e9f28449fda7d6c7f9a9ac (patch)
tree30d308bcc748733e5eefd7684aafa2d7e62c67a1 /firmware/target/arm/tcc780x/kernel-tcc780x.c
parent8739af490e03e243848720c5987f566a56479136 (diff)
downloadrockbox-75b37696fba2e0c5c1e9f28449fda7d6c7f9a9ac.tar.gz
rockbox-75b37696fba2e0c5c1e9f28449fda7d6c7f9a9ac.tar.bz2
rockbox-75b37696fba2e0c5c1e9f28449fda7d6c7f9a9ac.zip
TCC78x: Implement the user timer, rework some of the timer register #defines, and use udelay() instead of the hacky sleep_ms() in the D2 LCD driver. Doom works now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20585 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/tcc780x/kernel-tcc780x.c')
-rw-r--r--firmware/target/arm/tcc780x/kernel-tcc780x.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/firmware/target/arm/tcc780x/kernel-tcc780x.c b/firmware/target/arm/tcc780x/kernel-tcc780x.c
index e5d96d288a..dee5e040e2 100644
--- a/firmware/target/arm/tcc780x/kernel-tcc780x.c
+++ b/firmware/target/arm/tcc780x/kernel-tcc780x.c
@@ -29,16 +29,13 @@
void tick_start(unsigned int interval_in_ms)
{
/* disable Timer0 */
- TCFG0 &= ~1;
+ TCFG(0) &= ~TCFG_EN;
/* set counter reference value based on 1Mhz tick */
- TREF0 = interval_in_ms * 1000;
+ TREF(0) = interval_in_ms * 1000;
/* Timer0 = reset to 0, divide=2, IRQ enable, enable (continuous) */
- TCFG0 = (1<<8) | (0<<4) | (1<<3) | 1;
-
- /* Unmask timer IRQ */
- IEN |= TIMER0_IRQ_MASK;
+ 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