From: richardbarry Date: Sun, 6 Apr 2008 09:25:00 +0000 (+0000) Subject: Corrected SysTick interval calculation. X-Git-Tag: V5.0.0~32 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6007d6a8112cc4f8cc3368a052ff8fda5150f6dd;p=freertos Corrected SysTick interval calculation. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@292 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/portable/GCC/ARM_CM3/port.c b/Source/portable/GCC/ARM_CM3/port.c index cc3568fde..eb0e03340 100644 --- a/Source/portable/GCC/ARM_CM3/port.c +++ b/Source/portable/GCC/ARM_CM3/port.c @@ -276,7 +276,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; } /*-----------------------------------------------------------*/