fix crash if incorrect state on collisions v1

This commit is contained in:
Alex Lisitsyn
2025-04-26 04:05:29 +08:00
parent e8317c2822
commit 12d540118e
2 changed files with 7 additions and 3 deletions

View File

@ -245,7 +245,9 @@ xMBRTUReceiveFSM( void )
BOOL xStatus = FALSE; BOOL xStatus = FALSE;
UCHAR ucByte; UCHAR ucByte;
assert( eSndState == STATE_TX_IDLE ); if ( eSndState != STATE_TX_IDLE ) {
return FALSE;
}
/* Always read the character. */ /* Always read the character. */
xStatus = xMBPortSerialGetByte( ( CHAR * ) & ucByte ); xStatus = xMBPortSerialGetByte( ( CHAR * ) & ucByte );
@ -307,7 +309,9 @@ xMBRTUTransmitFSM( void )
{ {
BOOL xNeedPoll = TRUE; BOOL xNeedPoll = TRUE;
assert( eRcvState == STATE_RX_IDLE ); if ( eRcvState != STATE_RX_IDLE ) {
return FALSE;
}
switch ( eSndState ) switch ( eSndState )
{ {

View File

@ -1,4 +1,4 @@
version: "1.0.17" version: "1.0.18"
description: ESP-MODBUS is the official Modbus library for Espressif SoCs. description: ESP-MODBUS is the official Modbus library for Espressif SoCs.
url: https://github.com/espressif/esp-modbus url: https://github.com/espressif/esp-modbus
dependencies: dependencies: