Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rdd70052b03eeb284223a4aade8567a4acec63efb -r699c4f96ab672fb9db9ac218a5a00358dc68c2c6 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision dd70052b03eeb284223a4aade8567a4acec63efb) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 699c4f96ab672fb9db9ac218a5a00358dc68c2c6) @@ -981,21 +981,23 @@ // find expired messages pending ACK for ( i = 0; i < PENDING_ACK_LIST_SIZE; i++ ) - { + { // pending ACK expired? if ( ( TRUE == pendingAckList[ i ].used ) && ( TRUE == didTimeout( pendingAckList[ i ].timeStamp, MSG_NOT_ACKED_TIMEOUT_MS ) ) ) - { + { // if retries left, reset and resend pending message if ( pendingAckList[ i ].retries > 0 ) { // re-queue message for transmit pendingAckList[ i ].retries--; pendingAckList[ i ].timeStamp = getMSTimerCount(); addToCommBuffer( pendingAckList[ i ].channel, pendingAckList[ i ].msg, pendingAckList[ i ].msgSize ); - } + } + // if no retries left, alarm else { U16 msgID; memcpy( &msgID, &pendingAckList[ i ].msg[ sizeof( U08 ) + sizeof( U16) ], sizeof( U16 ) ); - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_CAN_MESSAGE_NOT_ACKED, (U32)msgID ); + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_CAN_MESSAGE_NOT_ACKED, (U32)msgID ); + pendingAckList[ i ].used = FALSE; // take pending message off of list } } }