Browse Source

【修复】 复位后串口打印第一个字节丢失的问题 | The loss of the first byte of serial port printing after reset.

BalanceTWK 6 năm trước cách đây
mục cha
commit
18bcd2b2c6
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      bsp/stm32f10x/drivers/usart.c

+ 2 - 0
bsp/stm32f10x/drivers/usart.c

@@ -100,6 +100,8 @@ static rt_err_t stm32_configure(struct rt_serial_device *serial, struct serial_c
 
     /* Enable USART */
     USART_Cmd(uart->uart_device, ENABLE);
+    
+    USART_ClearFlag(uart->uart_device,USART_FLAG_TC);
 
     return RT_EOK;
 }