Browse Source

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

winfenggao 2 years ago
parent
commit
ae66e67dee
1 changed files with 0 additions and 4 deletions
  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);
         }
-        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)
         {
             UART_INSTANCE_CLEAR_FUNCTION(&(uart->handle), UART_FLAG_RXNE);