[stm32][drv_usart]修复串口中断接收丢数据问题

使用串口中断方式接收数据,读取数据时会自动清除标识,这里再次清除中断标识会导致下一个数据丢失。
使用finsh就可以测出这个问题,中断接收丢数据时无法查看历史命令。
This commit is contained in:
HubretXie 2019-01-12 15:03:37 +08:00 committed by GitHub
parent 2f8f8f85e2
commit 706c0410cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -235,8 +235,6 @@ static void uart_isr(struct rt_serial_device *serial)
(__HAL_UART_GET_IT_SOURCE(&(uart->handle), UART_IT_RXNE) != RESET))
{
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
/* Clear RXNE interrupt flag */
UART_INSTANCE_CLEAR_FUNCTION(&(uart->handle), UART_FLAG_RXNE);
}
#ifdef RT_SERIAL_USING_DMA
else if ((uart->uart_dma_flag) && (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_IDLE) != RESET) &&