From 2145853b009e939dfbe14869b710133f50500a26 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 23 Dec 2015 07:29:47 +0100 Subject: score: Fix simple timecounter support Close #2502. --- c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c | 32 +++++++++++++++------------ 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c') diff --git a/c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c b/c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c index 4887d2a8e0..463125b459 100644 --- a/c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c +++ b/c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c @@ -45,9 +45,26 @@ static uint32_t lpc22xx_tc_get_timecount(struct timecounter *tc) ); } +/** + * When we get the clock interrupt + * - clear the interrupt bit? + * - restart the timer? + */ +static void lpc22xx_tc_at_tick(rtems_timecounter_simple *tc) +{ + if (!(T0IR & 0x01)) + return; + T0IR = 0x01; + VICVectAddr = 0x00; +} + static void lpc22xx_tc_tick(void) { - rtems_timecounter_simple_upcounter_tick(&lpc22xx_tc, lpc22xx_tc_get); + rtems_timecounter_simple_upcounter_tick( + &lpc22xx_tc, + lpc22xx_tc_get, + lpc22xx_tc_at_tick + ); } /* Replace the first value with the clock's interrupt name. */ @@ -62,19 +79,6 @@ rtems_irq_connect_data clock_isr_data = { /* use the /shared/clockdrv_shell.h code template */ -/** - * When we get the clock interrupt - * - clear the interrupt bit? - * - restart the timer? - */ -#define Clock_driver_support_at_tick() \ - do { \ - if (!(T0IR & 0x01)) \ - return; \ - T0IR = 0x01; \ - VICVectAddr = 0x00; \ - } while(0) - /** * Installs the clock ISR. You shouldn't need to change this. */ -- cgit v1.2.3