From 2ca3985a8c717a4abe824f53102e684597ff0508 Mon Sep 17 00:00:00 2001 From: Richard Barry Date: Sun, 6 Apr 2008 09:25:59 +0000 Subject: [PATCH] Corrected SysTick interval calculation. --- Source/portable/IAR/ARM_CM3/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/portable/IAR/ARM_CM3/port.c b/Source/portable/IAR/ARM_CM3/port.c index 5059de372..be91fdfb3 100644 --- a/Source/portable/IAR/ARM_CM3/port.c +++ b/Source/portable/IAR/ARM_CM3/port.c @@ -200,7 +200,7 @@ void xPortSysTickHandler( void ) void prvSetupTimerInterrupt( void ) { /* Configure SysTick to interrupt at the requested rate. */ - *(portNVIC_SYSTICK_LOAD) = configCPU_CLOCK_HZ / configTICK_RATE_HZ; + *(portNVIC_SYSTICK_LOAD) = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL; *(portNVIC_SYSTICK_CTRL) = portNVIC_SYSTICK_CLK | portNVIC_SYSTICK_INT | portNVIC_SYSTICK_ENABLE; } /*-----------------------------------------------------------*/