UART_FLAG_TC 不能在中断里CLEAR;
因为函数 static int stm32_putc(struct rt_serial_device *serial, char c)里发送完成后
while 循环等这个标志退出,中断服务函数CLEAR后,此处进入死循环
This commit is contained in:
winfenggao authored and Man, Jianting (Meco) committed 2022-08-25 10:25:34 -04:00
1 parent c67cbdb30c
commit ae66e67dee
1 file changed
-4
@@ -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);