summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-01-09 23:24:02 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-01-09 23:24:02 +0000
commitfe79cd8fa960d0fdf0bc2a4bc267b98833d9d311 (patch)
treea8c319b7212c7c47b6fca32a0695892a1f7f213c
parent9bb49ca6cb9779cf940ee20f1ddb258dc1cac078 (diff)
Jean-Philippe Bernardy: ported to gmini120
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5545 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/kernel.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c
index 221f8a3b38..7ca165c512 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -251,6 +251,57 @@ void TIMER0(void)
TER0 = 0xff; /* Clear all events */
}
+
+#elif CONFIG_CPU == TCC730
+
+void TIMER0(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();
+
+ /* re-enable timer by clearing the counter */
+ TACON |= 0x80;
+}
+
+static void tick_start(unsigned int interval_in_ms)
+{
+ u32 count;
+ count = (long)FREQ * (long)interval_in_ms / 1000 / 16;
+
+ if(count > 0xffffL)
+ {
+ panicf("Error! The tick interval is too long (%dms->%x)\n",
+ interval_in_ms, count);
+ return;
+ }
+
+ /* Use timer A */
+ TAPRE = 0x0;
+ TADATA = (u16)count;
+
+ TACON = 0x89;
+ /* counter clear; */
+ /* interval mode; */
+ /* TICS = F(osc) / 16 */
+ /* TCS = internal clock */
+ /* enable */
+
+ /* enable the interrupt */
+ interruptVector[2] = TIMER0;
+ IMR0 |= (1<<2);
+}
+
#endif
int tick_add_task(void (*f)(void))