summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/timer.h11
-rw-r--r--firmware/timer.c4
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 @@
25 25
26#ifndef SIMULATOR 26#ifndef SIMULATOR
27 27
28/* Assume timer base freq. is CPU clock base freq. Portalplayer chips use a 28
29 microsecond timer instead. */
30#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 29#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002
31#define TIMER_FREQ 1000000 30 /* Portalplayer chips use a microsecond timer. */
31 #define TIMER_FREQ 1000000
32#elif defined(CPU_COLDFIRE)
33 /* timer is based on busclk == cpuclk/2 */
34 #define TIMER_FREQ (CPU_FREQ/2)
32#else 35#else
33#define TIMER_FREQ CPU_FREQ 36 #define TIMER_FREQ CPU_FREQ
34#endif 37#endif
35 38
36bool timer_register(int reg_prio, void (*unregister_callback)(void), 39bool 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)
70 (void)start; 70 (void)start;
71#endif 71#endif
72 72
73#ifdef CPU_COLDFIRE
74 cycles >>= 1; /* the coldfire timer works on busclk == cpuclk/2 */
75#endif
76
77/* Don't do this on ipods, we don't know if these platforms have prescaler 73/* Don't do this on ipods, we don't know if these platforms have prescaler
78 capabilities on the timer we use. */ 74 capabilities on the timer we use. */
79#if CONFIG_CPU != PP5020 && CONFIG_CPU != PP5002 75#if CONFIG_CPU != PP5020 && CONFIG_CPU != PP5002