Corrected SysTick interval calculation.

This commit is contained in:
Richard Barry 2008-04-06 09:26:51 +00:00
parent 2ca3985a8c
commit a3677612d2

View File

@ -257,7 +257,7 @@ void xPortSysTickHandler( void )
void prvSetupTimerInterrupt( void ) void prvSetupTimerInterrupt( void )
{ {
/* Configure SysTick to interrupt at the requested rate. */ /* 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; *(portNVIC_SYSTICK_CTRL) = portNVIC_SYSTICK_CLK | portNVIC_SYSTICK_INT | portNVIC_SYSTICK_ENABLE;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/