Pārlūkot izejas kodu

[bsp][stm32][rsoc]串口超时判断逻辑有问题

[bsp][stm32]fix uart bug
CYFS 9 mēneši atpakaļ
vecāks
revīzija
76adf376db
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart.c

+ 1 - 1
bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart.c

@@ -357,7 +357,7 @@ static int stm32_putc(struct rt_serial_device *serial, char c)
 #else
     uart->handle.Instance->DR = c;
 #endif
-    while (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_TC) == RESET && block_timeout--);
+    while (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_TC) == RESET && --block_timeout);
     return (block_timeout != 0) ? 1 : -1;
 }