Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rb6416214042da75dfa311b726e401442b34315d7 -rc50cda7ff8b7d95c3daddce2c66904934b069a9d --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision b6416214042da75dfa311b726e401442b34315d7) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision c50cda7ff8b7d95c3daddce2c66904934b069a9d) @@ -49,8 +49,8 @@ #define MAX_COMM_CRC_FAILURES 5 ///< maximum number of CRC errors within window period before alarm #define MAX_COMM_CRC_FAILURE_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< CRC error window -#define MSG_NOT_ACKED_TIMEOUT_MS 150 ///< maximum time for a Denali message that requires ACK to be ACK'd -#define MSG_NOT_ACKED_MAX_RETRIES 8 ///< maximum number of times a message that requires ACK that was not ACK'd can be re-sent before alarm +#define MSG_NOT_ACKED_TIMEOUT_MS 250 ///< maximum time for a Denali message that requires ACK to be ACK'd +#define MSG_NOT_ACKED_MAX_RETRIES 10 ///< maximum number of times a message that requires ACK that was not ACK'd can be re-sent before alarm #define PENDING_ACK_LIST_SIZE 25 ///< maximum number of Delanli messages that can be pending ACK at any given time #define MAX_FPGA_CLOCK_SPEED_ERRORS 3 ///< maximum number of FPGA clock speed errors within window period before alarm @@ -770,27 +770,41 @@ U32 i; // 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. Do not retry when in POST since the UI might not still be responsive - if ( ( pendingAckList[ i ].retries > 0 ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) - { // 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; + if( TRUE == isHDCommunicating() ) + { + 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. Do not retry when in POST since the UI might not still be responsive + if ( pendingAckList[ i ].retries > 0 ) + { + if ( getCurrentOperationMode() != DG_MODE_INIT ) + { // If not in post, limit the number of retries + pendingAckList[ i ].retries--; + } + // Resend message + 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_DG_CAN_MESSAGE_NOT_ACKED, (U32)msgID ); - pendingAckList[ i ].used = FALSE; // take pending message off of list + memcpy( &msgID, &pendingAckList[ i ].msg[ sizeof( U08 ) + sizeof( U16 ) ], sizeof( U16 ) ); + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_CAN_MESSAGE_NOT_ACKED, (U32)msgID ); + pendingAckList[ i ].used = FALSE; // take pending message off of list + } } } } + else + { // Clear pending ACK list + for ( i = 0; i < PENDING_ACK_LIST_SIZE; i++ ) + { + pendingAckList[ i ].used = FALSE; + } + } } /*********************************************************************//**