Fixed MS/TP where double messages were send on Data-expecting-reply frames. Thank you, Simone Tolotti.
This commit is contained in:
@@ -1122,6 +1122,8 @@ static bool MSTP_Master_Node_FSM(
|
|||||||
Master_State = MSTP_MASTER_STATE_IDLE;
|
Master_State = MSTP_MASTER_STATE_IDLE;
|
||||||
/* clear our flag we were holding for comparison */
|
/* clear our flag we were holding for comparison */
|
||||||
MSTP_Flag.ReceivedValidFrame = false;
|
MSTP_Flag.ReceivedValidFrame = false;
|
||||||
|
/* clear the queue */
|
||||||
|
(void) Ringbuf_Pop(&PDU_Queue, NULL);
|
||||||
} else if ((Timer_Silence() > Treply_delay) || (pkt != NULL)) {
|
} else if ((Timer_Silence() > Treply_delay) || (pkt != NULL)) {
|
||||||
/* DeferredReply */
|
/* DeferredReply */
|
||||||
/* If no reply will be available from the higher layers */
|
/* If no reply will be available from the higher layers */
|
||||||
|
|||||||
@@ -1236,6 +1236,8 @@ static bool MSTP_Master_Node_FSM(
|
|||||||
Master_State = MSTP_MASTER_STATE_IDLE;
|
Master_State = MSTP_MASTER_STATE_IDLE;
|
||||||
/* clear our flag we were holding for comparison */
|
/* clear our flag we were holding for comparison */
|
||||||
MSTP_Flag.ReceivedValidFrame = false;
|
MSTP_Flag.ReceivedValidFrame = false;
|
||||||
|
/* clear the queue */
|
||||||
|
(void) Ringbuf_Pop(&PDU_Queue, NULL);
|
||||||
} else if (rs485_silence_elapsed(Treply_delay) || (pkt != NULL)) {
|
} else if (rs485_silence_elapsed(Treply_delay) || (pkt != NULL)) {
|
||||||
/* DeferredReply */
|
/* DeferredReply */
|
||||||
/* If no reply will be available from the higher layers */
|
/* If no reply will be available from the higher layers */
|
||||||
|
|||||||
Reference in New Issue
Block a user