diff --git a/bsp/stm32f107/drivers/usart.c b/bsp/stm32f107/drivers/usart.c index 6380f03bdf7d9ec04998b8695235405ad19fcfa7..89528d54bc8229f945c96199e88a30956d4fb6c4 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 898a0135c8c9afd3f164fa66ca53459525b83246..65a05c3afe412affbf9c62a9559a1d4796dd14a3 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 0838d214e265fe4a8fd6a26f988fa3d15d604a88..03d8c23235426559c17399d10d74db9d692e2189 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 c7e07826b98be66355b738c5d863127308f42402..40c29348cef6952cc6efad33e148801902311372 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 )