浏览代码

bug:
UART_FLAG_TC 不能在中断里CLEAR;
因为函数 static int stm32_putc(struct rt_serial_device *serial, char c)里发送完成后
while 循环等这个标志退出,中断服务函数CLEAR后,此处进入死循环

winfenggao 2 年之前
父节点
当前提交
ae66e67dee
共有 1 个文件被更改,包括 0 次插入4 次删除
  1. 0 4
      bsp/stm32/libraries/HAL_Drivers/drv_usart.c

+ 0 - 4
bsp/stm32/libraries/HAL_Drivers/drv_usart.c

@@ -457,10 +457,6 @@ static void uart_isr(struct rt_serial_device *serial)
         {
         {
             UART_INSTANCE_CLEAR_FUNCTION(&(uart->handle), UART_FLAG_TXE);
             UART_INSTANCE_CLEAR_FUNCTION(&(uart->handle), UART_FLAG_TXE);
         }
         }
-        if (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_TC) != RESET)
-        {
-            UART_INSTANCE_CLEAR_FUNCTION(&(uart->handle), UART_FLAG_TC);
-        }
         if (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_RXNE) != RESET)
         if (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_RXNE) != RESET)
         {
         {
             UART_INSTANCE_CLEAR_FUNCTION(&(uart->handle), UART_FLAG_RXNE);
             UART_INSTANCE_CLEAR_FUNCTION(&(uart->handle), UART_FLAG_RXNE);