Merge pull request #1682 from guochuangjian/master

更新stm32f10x usart驱动bug及modbus rtu断言bug
This commit is contained in:
Bernard Xiong 2018-08-06 13:39:41 +08:00 committed by GitHub
commit fb539cfdc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -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)
} }
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 */

View File

@ -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);
} }
} }

View File

@ -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);
} }
} }

View File

@ -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 )