From e77f625401bbeb23867dae0707080a38682ed58c Mon Sep 17 00:00:00 2001 From: Jan Sommer Date: Tue, 7 Jul 2015 22:33:51 +0200 Subject: RaspberryPi: Use rtems_configuration_get_microseconds_per_tick to set clock counter timer interrupt was hard coded to 10 ms per tick. Fix uses the setting of CONFIGURE_MICROSECONDS_PER_TICK to compute the correct start value for the counter See for more information: http://permalink.gmane.org/gmane.os.rtems.user/22691 --- c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'c/src/lib/libbsp/arm/raspberrypi') diff --git a/c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c b/c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c index f765485570..4ce795fb30 100644 --- a/c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c +++ b/c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c @@ -50,8 +50,10 @@ static void raspberrypi_clock_handler_install(void) static void raspberrypi_clock_initialize(void) { BCM2835_REG(BCM2835_TIMER_CTL) = 0x003E0000; - BCM2835_REG(BCM2835_TIMER_LOD) = 10000 - 1; - BCM2835_REG(BCM2835_TIMER_RLD) = 10000 - 1; + BCM2835_REG(BCM2835_TIMER_LOD) = + rtems_configuration_get_microseconds_per_tick() - 1; + BCM2835_REG(BCM2835_TIMER_RLD) = + rtems_configuration_get_microseconds_per_tick() - 1; BCM2835_REG(BCM2835_TIMER_DIV) = BCM2835_TIMER_PRESCALE; BCM2835_REG(BCM2835_TIMER_CLI) = 0; BCM2835_REG(BCM2835_TIMER_CTL) = 0x003E00A2; -- cgit v1.2.3