From 63a13906cc0673b2bc42ca5641d523c9be5e4887 Mon Sep 17 00:00:00 2001 From: guochuangjian <465469791@qq.com> Date: Sun, 5 Aug 2018 15:25:31 +0800 Subject: [PATCH] fix uart ore-flag clear bug --- bsp/stm32f107/drivers/usart.c | 4 ++-- bsp/stm32f40x/drivers/usart.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp/stm32f107/drivers/usart.c b/bsp/stm32f107/drivers/usart.c index 6380f03bd..89528d54b 100644 --- a/bsp/stm32f107/drivers/usart.c +++ b/bsp/stm32f107/drivers/usart.c @@ -184,7 +184,7 @@ void USART1_IRQHandler(void) } if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET) { - stm32_getc(&serial1); + USART_ReceiveData(uart->uart_device); } /* leave interrupt */ rt_interrupt_leave(); @@ -221,7 +221,7 @@ void USART2_IRQHandler(void) } if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET) { - stm32_getc(&serial2); + USART_ReceiveData(uart->uart_device); } /* leave interrupt */ diff --git a/bsp/stm32f40x/drivers/usart.c b/bsp/stm32f40x/drivers/usart.c index 0838d214e..03d8c2323 100644 --- a/bsp/stm32f40x/drivers/usart.c +++ b/bsp/stm32f40x/drivers/usart.c @@ -310,7 +310,7 @@ static void uart_isr(struct rt_serial_device *serial) } if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET) { - stm32_getc(serial); + USART_ReceiveData(uart->uart_device); } } -- GitLab