Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r5652568f680408e60fe5fb84eee926e8804c07d7 -re4b1961935d9f5d519f2164a1e526fcd4f7295c0 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 5652568f680408e60fe5fb84eee926e8804c07d7) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision e4b1961935d9f5d519f2164a1e526fcd4f7295c0) @@ -41,15 +41,15 @@ #define NUM_OF_CAN_IN_BUFFERS 7 ///< Number of CAN buffers for receiving #define NUM_OF_MSG_IN_BUFFERS 7 ///< Number of Msg buffers for receiving -#define CAN_XMIT_PACKET_TIMEOUT_MS 200 ///< if transmitted CAN frame does not cause a transmit complete interrupt within this time, re-send or move on +#define CAN_XMIT_PACKET_TIMEOUT_MS 250 ///< if transmitted CAN frame does not cause a transmit complete interrupt within this time, re-send or move on #define MAX_XMIT_RETRIES 5 ///< maximum number of retries on no transmit complete interrupt timeout #define HD_COMM_TIMEOUT_IN_MS 2000 ///< HD has not sent any broadcast messages for this much time #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_TIMEOUT_MS 250 ///< 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 PENDING_ACK_LIST_SIZE 25 ///< maximum number of Delanli messages that can be pending ACK at any given time @@ -770,24 +770,27 @@ 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 ) && ( 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; - 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 + } } } }