From 295ec69717a758c527a58ca154dba25c7c22fae5 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Tue, 4 Apr 2006 01:16:11 +0000 Subject: Simplification for user timer on coldfire. We define TIMER_FREQ separately anyway. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9479 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/timer.h | 11 +++++++---- firmware/timer.c | 4 ---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/firmware/export/timer.h b/firmware/export/timer.h index 15b5f108a3..2fb7c6495f 100644 --- a/firmware/export/timer.h +++ b/firmware/export/timer.h @@ -25,12 +25,15 @@ #ifndef SIMULATOR -/* Assume timer base freq. is CPU clock base freq. Portalplayer chips use a - microsecond timer instead. */ + #if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 -#define TIMER_FREQ 1000000 + /* Portalplayer chips use a microsecond timer. */ + #define TIMER_FREQ 1000000 +#elif defined(CPU_COLDFIRE) + /* timer is based on busclk == cpuclk/2 */ + #define TIMER_FREQ (CPU_FREQ/2) #else -#define TIMER_FREQ CPU_FREQ + #define TIMER_FREQ CPU_FREQ #endif bool timer_register(int reg_prio, void (*unregister_callback)(void), diff --git a/firmware/timer.c b/firmware/timer.c index 54e3dc7ac3..666bdb972b 100644 --- a/firmware/timer.c +++ b/firmware/timer.c @@ -70,10 +70,6 @@ static bool timer_set(long cycles, bool start) (void)start; #endif -#ifdef CPU_COLDFIRE - cycles >>= 1; /* the coldfire timer works on busclk == cpuclk/2 */ -#endif - /* Don't do this on ipods, we don't know if these platforms have prescaler capabilities on the timer we use. */ #if CONFIG_CPU != PP5020 && CONFIG_CPU != PP5002 -- cgit v1.2.3