Merge branch 'bugfix/slave_fix_crash_on_incorrect_state_on_collision' into 'master'

fix crash if incorrect state on collisions v1

Closes IDFGH-15008

See merge request idf/esp-modbus!115
This commit is contained in:
Alex Lisitsyn
2025-04-26 04:05:29 +08:00
2 changed files with 7 additions and 3 deletions

View File

@ -245,7 +245,9 @@ xMBRTUReceiveFSM( void )
BOOL xStatus = FALSE;
UCHAR ucByte;
assert( eSndState == STATE_TX_IDLE );
if ( eSndState != STATE_TX_IDLE ) {
return FALSE;
}
/* Always read the character. */
xStatus = xMBPortSerialGetByte( ( CHAR * ) & ucByte );
@ -307,7 +309,9 @@ xMBRTUTransmitFSM( void )
{
BOOL xNeedPoll = TRUE;
assert( eRcvState == STATE_RX_IDLE );
if ( eRcvState != STATE_RX_IDLE ) {
return FALSE;
}
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.
url: https://github.com/espressif/esp-modbus
dependencies: