From 0893e542930b1f0c81a4e2cc0893939a08c456bf Mon Sep 17 00:00:00 2001 From: ZYH Date: Thu, 11 Oct 2018 11:38:04 +0800 Subject: [PATCH] =?UTF-8?q?[bsp][stm32f1xx-hal]=E4=BF=AE=E5=A4=8D=E5=BD=93?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E4=BC=98=E5=8C=96=E6=97=B6m3=5Fm4=5Fdelay=5F?= =?UTF-8?q?us=E5=BB=B6=E6=97=B6=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/stm32f10x-HAL/drivers/board.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bsp/stm32f10x-HAL/drivers/board.c b/bsp/stm32f10x-HAL/drivers/board.c index 7ce0503f9..5c7e44c4f 100644 --- a/bsp/stm32f10x-HAL/drivers/board.c +++ b/bsp/stm32f10x-HAL/drivers/board.c @@ -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) -- GitLab