mirror of
https://github.com/espressif/esp-modbus.git
synced 2026-08-03 20:24:09 +02:00
fix crash if incorrect state on collisions v1
This commit is contained in:
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user