Bugfix/master rtu ascii fix deadlock when null received

This commit is contained in:
Alex Lisitsyn
2023-06-15 23:43:37 +08:00
parent cd34b914d3
commit 7cdafc2468
2 changed files with 2 additions and 2 deletions

View File

@ -274,8 +274,8 @@ xMBMasterASCIIReceiveFSM( void )
usMasterRcvBufferPos = 0; usMasterRcvBufferPos = 0;
eBytePos = BYTE_HIGH_NIBBLE; eBytePos = BYTE_HIGH_NIBBLE;
eRcvState = STATE_M_RX_RCV; eRcvState = STATE_M_RX_RCV;
eSndState = STATE_M_TX_IDLE;
} }
eSndState = STATE_M_TX_IDLE;
break; break;
/* A new character is received. If the character is a ':' the input /* A new character is received. If the character is a ':' the input

View File

@ -284,12 +284,12 @@ xMBMasterRTUReceiveFSM( void )
* Disable timer of respond timeout and change the transmiter state to idle. * Disable timer of respond timeout and change the transmiter state to idle.
*/ */
vMBMasterPortTimersDisable( ); vMBMasterPortTimersDisable( );
eSndState = STATE_M_TX_IDLE;
usMasterRcvBufferPos = 0; usMasterRcvBufferPos = 0;
if( xStatus && ucByte ) { if( xStatus && ucByte ) {
ucMasterRTURcvBuf[usMasterRcvBufferPos++] = ucByte; ucMasterRTURcvBuf[usMasterRcvBufferPos++] = ucByte;
eRcvState = STATE_M_RX_RCV; eRcvState = STATE_M_RX_RCV;
eSndState = STATE_M_TX_IDLE;
} }
/* Enable t3.5 timers. */ /* Enable t3.5 timers. */