diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_common.c b/bsp/stm32/libraries/HAL_Drivers/drv_common.c index 0dfffda874..dcf002dcc0 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_common.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_common.c @@ -133,11 +133,11 @@ void _Error_Handler(char *s, int num) */ void rt_hw_us_delay(rt_uint32_t us) { - rt_uint32_t ticks; + rt_uint64_t ticks; rt_uint32_t told, tnow, tcnt = 0; rt_uint32_t reload = SysTick->LOAD; - ticks = us * reload / (1000000 / RT_TICK_PER_SECOND); + ticks = us * (reload / (1000000 / RT_TICK_PER_SECOND)); told = SysTick->VAL; while (1) {