summaryrefslogtreecommitdiffstats
path: root/firmware/timer.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-01-05 00:00:29 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-01-05 00:00:29 +0000
commite2876ee4e2ff260e616863b2c54004516743e766 (patch)
tree4abaff62e18b6a15302391c45eb60ab5174ee4dd /firmware/timer.c
parent6d5823f964d8cc2b030d7a713d355f3132e41c45 (diff)
downloadrockbox-e2876ee4e2ff260e616863b2c54004516743e766.tar.gz
rockbox-e2876ee4e2ff260e616863b2c54004516743e766.tar.bz2
rockbox-e2876ee4e2ff260e616863b2c54004516743e766.zip
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
Diffstat (limited to 'firmware/timer.c')
-rw-r--r--firmware/timer.c18
1 files changed, 10 insertions, 8 deletions
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;