diff --git a/bsp/stm32f107/drivers/usart.c b/bsp/stm32f107/drivers/usart.c index 6380f03bdf..89528d54bc 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/stm32f10x/drivers/usart.c b/bsp/stm32f10x/drivers/usart.c index 898a0135c8..65a05c3afe 100644 --- a/bsp/stm32f10x/drivers/usart.c +++ b/bsp/stm32f10x/drivers/usart.c @@ -270,7 +270,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); } } diff --git a/bsp/stm32f40x/drivers/usart.c b/bsp/stm32f40x/drivers/usart.c index 0838d214e2..03d8c23235 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); } } diff --git a/components/net/freemodbus/modbus/rtu/mbrtu.c b/components/net/freemodbus/modbus/rtu/mbrtu.c index c7e07826b9..40c29348ce 100644 --- a/components/net/freemodbus/modbus/rtu/mbrtu.c +++ b/components/net/freemodbus/modbus/rtu/mbrtu.c @@ -153,7 +153,7 @@ eMBRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength ) eMBErrorCode eStatus = MB_ENOERR; ENTER_CRITICAL_SECTION( ); - RT_ASSERT( usRcvBufferPos < MB_SER_PDU_SIZE_MAX ); + RT_ASSERT( usRcvBufferPos <= MB_SER_PDU_SIZE_MAX ); /* Length and CRC check */ if( ( usRcvBufferPos >= MB_SER_PDU_SIZE_MIN )