From 4ae87c8b8ab7ddbd286f5288adaddcaf0a187e31 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 6 Jul 2007 21:36:32 +0000 Subject: Gigabeat: Add timer functionality. Rework tick timer setup to be exactly 100Hz. Metronome should work now but some pcm changes are needed to have faster tocks work correctly (in the works). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13806 a1c6a512-1295-4272-9138-f99709370657 --- firmware/kernel.c | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'firmware/kernel.c') diff --git a/firmware/kernel.c b/firmware/kernel.c index 2d4ccde..b1a4e62 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c @@ -29,7 +29,7 @@ volatile long current_tick NOCACHEDATA_ATTR = 0; #endif -static void (*tick_funcs[MAX_NUM_TICK_TASKS])(void); +void (*tick_funcs[MAX_NUM_TICK_TASKS])(void); /* This array holds all queues that are initiated. It is used for broadcast. */ static struct event_queue *all_queues[32] NOCACHEBSS_ATTR; @@ -708,40 +708,6 @@ void tick_start(unsigned int interval_in_ms) TIMER0.ctrl |= 0x80; /* Enable the counter */ } -#elif CONFIG_CPU == S3C2440 -void tick_start(unsigned int interval_in_ms) -{ - TCON &= ~(1 << 20); // stop timer 4 - // TODO: this constant depends on dividers settings inherited from - // firmware. Set them explicitly somwhere. - TCNTB4 = 12193 * interval_in_ms / 1000; - TCON |= 1 << 21; // set manual bit - TCON &= ~(1 << 21); // reset manual bit - TCON |= 1 << 22; //interval mode - TCON |= (1 << 20); // start timer 4 - - INTMOD &= ~(1 << 14); // timer 4 to IRQ mode - INTMSK &= ~(1 << 14); // timer 4 unmask interrupts -} - -void TIMER4(void) -{ - int i; - - SRCPND = TIMER4_MASK; - INTPND = TIMER4_MASK; - - /* 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++; -} #endif int tick_add_task(void (*f)(void)) -- cgit v1.1