Changed MS/TP idle state: when no-token timeout occurs, clear the receive frame flags in case a message was received and timeout occurred, which may cause MS/TP to stop working in optimized dlmstp loops which don't check for new events when either of those flags are set. Thank you, Jason!
This commit is contained in:
@@ -727,6 +727,10 @@ static bool MSTP_Master_Node_FSM(
|
|||||||
/* assume that the token has been lost */
|
/* assume that the token has been lost */
|
||||||
EventCount = 0; /* Addendum 135-2004d-8 */
|
EventCount = 0; /* Addendum 135-2004d-8 */
|
||||||
Master_State = MSTP_MASTER_STATE_NO_TOKEN;
|
Master_State = MSTP_MASTER_STATE_NO_TOKEN;
|
||||||
|
/* set the receive frame flags to false in case we received
|
||||||
|
some bytes and had a timeout for some reason */
|
||||||
|
MSTP_Flag.ReceivedValidFrame = false;
|
||||||
|
MSTP_Flag.ReceivedInvalidFrame = false;
|
||||||
transition_now = true;
|
transition_now = true;
|
||||||
} else if (MSTP_Flag.ReceivedInvalidFrame == true) {
|
} else if (MSTP_Flag.ReceivedInvalidFrame == true) {
|
||||||
/* ReceivedInvalidFrame */
|
/* ReceivedInvalidFrame */
|
||||||
|
|||||||
@@ -636,6 +636,10 @@ static bool MSTP_Master_Node_FSM(
|
|||||||
/* assume that the token has been lost */
|
/* assume that the token has been lost */
|
||||||
EventCount = 0; /* Addendum 135-2004d-8 */
|
EventCount = 0; /* Addendum 135-2004d-8 */
|
||||||
Master_State = MSTP_MASTER_STATE_NO_TOKEN;
|
Master_State = MSTP_MASTER_STATE_NO_TOKEN;
|
||||||
|
/* set the receive frame flags to false in case we received
|
||||||
|
some bytes and had a timeout for some reason */
|
||||||
|
MSTP_Flag.ReceivedValidFrame = false;
|
||||||
|
MSTP_Flag.ReceivedInvalidFrame = false;
|
||||||
transition_now = true;
|
transition_now = true;
|
||||||
} else if (MSTP_Flag.ReceivedInvalidFrame == true) {
|
} else if (MSTP_Flag.ReceivedInvalidFrame == true) {
|
||||||
/* ReceivedInvalidFrame */
|
/* ReceivedInvalidFrame */
|
||||||
|
|||||||
@@ -724,6 +724,10 @@ static bool MSTP_Master_Node_FSM(
|
|||||||
/* assume that the token has been lost */
|
/* assume that the token has been lost */
|
||||||
EventCount = 0; /* Addendum 135-2004d-8 */
|
EventCount = 0; /* Addendum 135-2004d-8 */
|
||||||
Master_State = MSTP_MASTER_STATE_NO_TOKEN;
|
Master_State = MSTP_MASTER_STATE_NO_TOKEN;
|
||||||
|
/* set the receive frame flags to false in case we received
|
||||||
|
some bytes and had a timeout for some reason */
|
||||||
|
MSTP_Flag.ReceivedValidFrame = false;
|
||||||
|
MSTP_Flag.ReceivedInvalidFrame = false;
|
||||||
transition_now = true;
|
transition_now = true;
|
||||||
} else if (MSTP_Flag.ReceivedInvalidFrame == true) {
|
} else if (MSTP_Flag.ReceivedInvalidFrame == true) {
|
||||||
/* ReceivedInvalidFrame */
|
/* ReceivedInvalidFrame */
|
||||||
|
|||||||
@@ -607,6 +607,10 @@ bool MSTP_Master_Node_FSM(
|
|||||||
/* assume that the token has been lost */
|
/* assume that the token has been lost */
|
||||||
mstp_port->EventCount = 0; /* Addendum 135-2004d-8 */
|
mstp_port->EventCount = 0; /* Addendum 135-2004d-8 */
|
||||||
mstp_port->master_state = MSTP_MASTER_STATE_NO_TOKEN;
|
mstp_port->master_state = MSTP_MASTER_STATE_NO_TOKEN;
|
||||||
|
/* set the receive frame flags to false in case we received
|
||||||
|
some bytes and had a timeout for some reason */
|
||||||
|
mstp_port->ReceivedInvalidFrame = false;
|
||||||
|
mstp_port->ReceivedValidFrame = false;
|
||||||
transition_now = true;
|
transition_now = true;
|
||||||
}
|
}
|
||||||
/* ReceivedInvalidFrame */
|
/* ReceivedInvalidFrame */
|
||||||
|
|||||||
@@ -742,6 +742,10 @@ bool MSTP_Master_Node_FSM(
|
|||||||
/* assume that the token has been lost */
|
/* assume that the token has been lost */
|
||||||
mstp_port->EventCount = 0; /* Addendum 135-2004d-8 */
|
mstp_port->EventCount = 0; /* Addendum 135-2004d-8 */
|
||||||
mstp_port->master_state = MSTP_MASTER_STATE_NO_TOKEN;
|
mstp_port->master_state = MSTP_MASTER_STATE_NO_TOKEN;
|
||||||
|
/* set the receive frame flags to false in case we received
|
||||||
|
some bytes and had a timeout for some reason */
|
||||||
|
mstp_port->ReceivedInvalidFrame = false;
|
||||||
|
mstp_port->ReceivedValidFrame = false;
|
||||||
transition_now = true;
|
transition_now = true;
|
||||||
}
|
}
|
||||||
/* ReceivedInvalidFrame */
|
/* ReceivedInvalidFrame */
|
||||||
|
|||||||
@@ -618,6 +618,10 @@ bool MSTP_Master_Node_FSM(
|
|||||||
/* assume that the token has been lost */
|
/* assume that the token has been lost */
|
||||||
mstp_port->EventCount = 0; /* Addendum 135-2004d-8 */
|
mstp_port->EventCount = 0; /* Addendum 135-2004d-8 */
|
||||||
mstp_port->master_state = MSTP_MASTER_STATE_NO_TOKEN;
|
mstp_port->master_state = MSTP_MASTER_STATE_NO_TOKEN;
|
||||||
|
/* set the receive frame flags to false in case we received
|
||||||
|
some bytes and had a timeout for some reason */
|
||||||
|
mstp_port->ReceivedInvalidFrame = false;
|
||||||
|
mstp_port->ReceivedValidFrame = false;
|
||||||
transition_now = true;
|
transition_now = true;
|
||||||
} else if (mstp_port->ReceivedInvalidFrame == true) {
|
} else if (mstp_port->ReceivedInvalidFrame == true) {
|
||||||
/* ReceivedInvalidFrame */
|
/* ReceivedInvalidFrame */
|
||||||
|
|||||||
Reference in New Issue
Block a user