提交 0893e542 编写于 作者: lymzzyh's avatar lymzzyh

[bsp][stm32f1xx-hal]修复当开启优化时m3_m4_delay_us延时失效问题

上级 6e5751d4
......@@ -115,11 +115,12 @@ void SystemClock_Config(void)
static void m3_m4_delay_us(rt_uint32_t us)
{
int i = (HAL_RCC_GetHCLKFreq() / 4000000 * us);
while (i)
__IO uint32_t Delay = us * (SystemCoreClock / 8U / 1000000U);
do
{
i--;
}
__NOP();
}
while (Delay --);
}
void HAL_Delay(__IO uint32_t Delay)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册