diff options
author | Jan Sommer <summerspam@web.de> | 2015-07-07 22:33:51 +0200 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2015-07-07 16:01:28 -0500 |
commit | e77f625401bbeb23867dae0707080a38682ed58c (patch) | |
tree | cf73e048ee3b1fdc892c30804d5979f566fe2dca | |
parent | bsp/qoriq: Update due to API changes (diff) | |
download | rtems-e77f625401bbeb23867dae0707080a38682ed58c.tar.bz2 |
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
-rw-r--r-- | c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |