From e2876ee4e2ff260e616863b2c54004516743e766 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Mon, 5 Jan 2009 00:00:29 +0000 Subject: Gigabeat S: Get timer API working. metronome will work now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19676 a1c6a512-1295-4272-9138-f99709370657 --- firmware/timer.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'firmware/timer.c') diff --git a/firmware/timer.c b/firmware/timer.c index a11cd10b7e..e9f11b6ae7 100644 --- a/firmware/timer.c +++ b/firmware/timer.c @@ -35,6 +35,15 @@ static int base_prescale; static long SHAREDBSS_ATTR cycles_new = 0; #endif +#ifndef __TIMER_SET +/* Define these if not defined by target to make the #else cases compile + * even if the target doesn't have them implemented. */ +#define __TIMER_SET(cycles, set) false +#define __TIMER_REGISTER(reg_prio, unregister_callback, cycles, \ + int_prio, timer_callback) false +#define __TIMER_UNREGISTER(...) +#endif + /* interrupt handler */ #if CONFIG_CPU == SH7034 void IMIA4(void) __attribute__((interrupt_handler)); @@ -245,10 +254,6 @@ static bool timer_set(long cycles, bool start) cycles_new = cycles; return true; -#elif (CONFIG_CPU == IMX31L) - /* TODO */ - (void)cycles; (void)start; - return false; #else return __TIMER_SET(cycles, start); #endif /* CONFIG_CPU */ @@ -319,9 +324,6 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void), CGU_PERI |= CGU_TIMER1_CLOCK_ENABLE; /* enable peripheral */ VIC_INT_ENABLE |= INTERRUPT_TIMER1; return true; -#elif CONFIG_CPU == IMX31L - /* TODO */ - return false; #else return __TIMER_REGISTER(reg_prio, unregister_callback, cycles, int_prio, timer_callback); @@ -359,7 +361,7 @@ void timer_unregister(void) TIMER1_CONTROL &= 0x10; /* disable timer 1 (don't modify bit 4) */ VIC_INT_EN_CLEAR = INTERRUPT_TIMER1; /* disable interrupt */ CGU_PERI &= ~CGU_TIMER1_CLOCK_ENABLE; /* disable peripheral */ -#elif CONFIG_CPU == S3C2440 || CONFIG_CPU == DM320 +#else __TIMER_UNREGISTER(); #endif pfn_timer = NULL; -- cgit v1.2.3