mirror of
https://github.com/apache/nuttx.git
synced 2026-05-10 07:18:49 +08:00
564c9d7dcd
ARM specifies that SysTick RELOAD must be programmed with N-1 to get a period of N CPU cycles. Adjust the timeout/reload conversions accordingly: subtract 1 when writing RELOAD and add 1 back when converting RELOAD to a timeout/interval. Also clamp RELOAD to the valid 24-bit range (1..0x00ffffff) for Armv7-M/Armv8-M to avoid invalid values. Reference: https://developer.arm.com/documentation/dui0646/c/Cortex-M7-Peripherals/System-timer--SysTick/SysTick-Reload-Value-Register Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>