1、【增加】《FreeModbus 主机分析图》,但部分图还需要完善;
2、【修改】《FreeModbus 从机分析图》部分错误; 3、【修改】mbrtu_m.c 中关于接收状态及定时器超时状态机相关内容 Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
parent
a5528950d0
commit
cb7ce7ee03
Binary file not shown.
Binary file not shown.
|
@ -56,14 +56,14 @@ typedef enum
|
|||
{
|
||||
STATE_M_RX_INIT, /*!< Receiver is in initial state. */
|
||||
STATE_M_RX_IDLE, /*!< Receiver is in idle state. */
|
||||
STATE_M_RX_RCV /*!< Frame is beeing received. */
|
||||
STATE_M_RX_RCV, /*!< Frame is beeing received. */
|
||||
STATE_M_RX_ERROR /*!< If the frame is invalid. */
|
||||
} eMBMasterRcvState;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
STATE_M_TX_IDLE, /*!< Transmitter is in idle state. */
|
||||
STATE_M_TX_XMIT, /*!< Transmitter is in transfer state. */
|
||||
STATE_M_TX_ERROR /*!< If the frame is invalid. */
|
||||
} eMBMasterSndState;
|
||||
|
||||
/* ----------------------- Static variables ---------------------------------*/
|
||||
|
@ -337,10 +337,15 @@ xMBMasterRTUTimerT35Expired( void )
|
|||
case STATE_M_RX_RCV:
|
||||
xNeedPoll = xMBMasterPortEventPost(EV_FRAME_RECEIVED);
|
||||
break;
|
||||
|
||||
/* An error occured while receiving the frame. */
|
||||
case STATE_RX_ERROR:
|
||||
break;
|
||||
|
||||
/* Function called in an illegal state. */
|
||||
default:
|
||||
assert_param(
|
||||
( eRcvState == STATE_M_RX_INIT ) || ( eRcvState == STATE_M_RX_RCV ));
|
||||
( eRcvState == STATE_M_RX_INIT ) || ( eRcvState == STATE_M_RX_RCV ) || ( eRcvState == STATE_M_RX_ERROR ));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -349,6 +354,13 @@ xMBMasterRTUTimerT35Expired( void )
|
|||
|
||||
//TODO 发送状态在超时后的状态转换需要添加
|
||||
|
||||
switch(eSndState)
|
||||
{
|
||||
/* Timer t35 expired. . */
|
||||
case STATE_M_TX_XMIT :
|
||||
|
||||
}
|
||||
|
||||
return xNeedPoll;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue