提交 fd08d0ba 编写于 作者: A Aubr.Cool

[Bsp] stm32f10x usart correct rx parity err

上级 d185f093
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* 2015-01-31 armink make sure the serial transmit complete in putc() * 2015-01-31 armink make sure the serial transmit complete in putc()
* 2016-05-13 armink add DMA Rx mode * 2016-05-13 armink add DMA Rx mode
* 2017-01-19 aubr.cool add interrupt Tx mode * 2017-01-19 aubr.cool add interrupt Tx mode
* 2017-04-13 aubr.cool correct Rx parity err
*/ */
#include "stm32f10x.h" #include "stm32f10x.h"
...@@ -262,7 +263,10 @@ static void uart_isr(struct rt_serial_device *serial) { ...@@ -262,7 +263,10 @@ static void uart_isr(struct rt_serial_device *serial) {
if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET) if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{ {
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND); if(USART_GetFlagStatus(uart->uart_device, USART_FLAG_PE) == RESET)
{
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
}
/* clear interrupt */ /* clear interrupt */
USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE); USART_ClearITPendingBit(uart->uart_device, USART_IT_RXNE);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册