diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-23 07:29:47 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-01-27 08:09:05 +0100 |
commit | 2145853b009e939dfbe14869b710133f50500a26 (patch) | |
tree | cb4504a3f442a83ea508a03b31aa8379b42790ed /c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c | |
parent | bsps/arm: Fix broken switch statement (diff) | |
download | rtems-2145853b009e939dfbe14869b710133f50500a26.tar.bz2 |
score: Fix simple timecounter support
Close #2502.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c | 32 |
1 files changed, 18 insertions, 14 deletions
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. */ @@ -63,19 +80,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. */ #define Clock_driver_support_install_isr( _new, _old ) \ |