[Bsp] stm32f10x usart correct rx parity err

This commit is contained in:
Aubr.Cool 2017-04-13 12:47:49 +08:00
parent d185f09303
commit fd08d0ba50
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@
* 2015-01-31 armink make sure the serial transmit complete in putc()
* 2016-05-13 armink add DMA Rx mode
* 2017-01-19 aubr.cool add interrupt Tx mode
* 2017-04-13 aubr.cool correct Rx parity err
*/
#include "stm32f10x.h"
@ -261,8 +262,11 @@ static void uart_isr(struct rt_serial_device *serial) {
RT_ASSERT(uart != RT_NULL);
if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{
if(USART_GetFlagStatus(uart->uart_device, USART_FLAG_PE) == RESET)
{
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
}
/* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
}