forked from Imagelibrary/rtems
bsps/arm: fix Cortex-M7 systick reload value
- see ARM DUI 0646C Arm Cortex-M7 Devices Generic User Guide "The RELOAD value is calculated according to its use. For example, to generate a multi-shot timer with a period of N processor clock cycles, use a RELOAD value of N-1. If the SysTick interrupt is required every 100 clock pulses, set RELOAD to 99." - see routines used in CMSIS project for reference Close #4746.
This commit is contained in:
committed by
Sebastian Huber
parent
f6bcf1636b
commit
1eae6f24fe
@@ -90,7 +90,7 @@ static void _ARMV7M_Clock_initialize_early(void)
|
||||
|
||||
interval = (uint32_t) ((freq * us_per_tick) / 1000000);
|
||||
|
||||
systick->rvr = interval;
|
||||
systick->rvr = interval - 1;
|
||||
systick->cvr = 0;
|
||||
systick->csr = ARMV7M_SYSTICK_CSR_ENABLE | ARMV7M_SYSTICK_CSR_CLKSOURCE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user