未验证 提交 fb539cfd 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #1682 from guochuangjian/master

更新stm32f10x usart驱动bug及modbus rtu断言bug
...@@ -184,7 +184,7 @@ void USART1_IRQHandler(void) ...@@ -184,7 +184,7 @@ void USART1_IRQHandler(void)
} }
if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET) if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET)
{ {
stm32_getc(&serial1); USART_ReceiveData(uart->uart_device);
} }
/* leave interrupt */ /* leave interrupt */
rt_interrupt_leave(); rt_interrupt_leave();
...@@ -221,7 +221,7 @@ void USART2_IRQHandler(void) ...@@ -221,7 +221,7 @@ void USART2_IRQHandler(void)
} }
if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET) if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET)
{ {
stm32_getc(&serial2); USART_ReceiveData(uart->uart_device);
} }
/* leave interrupt */ /* leave interrupt */
......
...@@ -270,7 +270,7 @@ static void uart_isr(struct rt_serial_device *serial) { ...@@ -270,7 +270,7 @@ static void uart_isr(struct rt_serial_device *serial) {
} }
if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET) if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET)
{ {
stm32_getc(serial); USART_ReceiveData(uart->uart_device);
} }
} }
......
...@@ -310,7 +310,7 @@ static void uart_isr(struct rt_serial_device *serial) ...@@ -310,7 +310,7 @@ static void uart_isr(struct rt_serial_device *serial)
} }
if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET) if (USART_GetFlagStatus(uart->uart_device, USART_FLAG_ORE) == SET)
{ {
stm32_getc(serial); USART_ReceiveData(uart->uart_device);
} }
} }
......
...@@ -153,7 +153,7 @@ eMBRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength ) ...@@ -153,7 +153,7 @@ eMBRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength )
eMBErrorCode eStatus = MB_ENOERR; eMBErrorCode eStatus = MB_ENOERR;
ENTER_CRITICAL_SECTION( ); ENTER_CRITICAL_SECTION( );
RT_ASSERT( usRcvBufferPos < MB_SER_PDU_SIZE_MAX ); RT_ASSERT( usRcvBufferPos <= MB_SER_PDU_SIZE_MAX );
/* Length and CRC check */ /* Length and CRC check */
if( ( usRcvBufferPos >= MB_SER_PDU_SIZE_MIN ) if( ( usRcvBufferPos >= MB_SER_PDU_SIZE_MIN )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册