Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r4375a4147ee6ced5c7f254a2869673c9559a3921 -ra45a2f0b7fa79050f4f25cca67325eb9223e96cb --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 4375a4147ee6ced5c7f254a2869673c9559a3921) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision a45a2f0b7fa79050f4f25cca67325eb9223e96cb) @@ -106,6 +106,7 @@ static U32 canXmitRetryCtr = 0; ///< counter for CAN transmit retries. static OVERRIDE_U32_T hdCommunicationStatus = {0, 0, 0, 0}; ///< has HD sent a message since last check static volatile U32 timeOfLastHDCheckIn = 0; ///< last time we received an HD broadcast +static OVERRIDE_U32_T pendingACKOverride = { 0, 0, 0, 0 }; ///< Pending ACK override data structure. // ********** private function prototypes ********** @@ -780,7 +781,7 @@ { 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 ( ( TRUE == pendingAckList[ i ].used ) && ( ( TRUE == didTimeout( pendingAckList[ i ].timeStamp, MSG_NOT_ACKED_TIMEOUT_MS ) ) || ( getU32OverrideValue( &pendingACKOverride ) > 0 ) ) ) { // 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 ) { @@ -1372,6 +1373,10 @@ handleTestDGReservoirOverrideRequest( message ); break; + case MSG_ID_DG_CAN_RECEIVE_ACK_MESSAGE_OVERRIDE: + handleTestDGPendingACKOverrideRequest( message ); + break; + default: // TODO - unrecognized message ID received - ignore break; @@ -1429,4 +1434,48 @@ return result; } +/*********************************************************************//** + * @brief + * The testSetPendingACKOverride function overrides the + * pendingACKOverride variable. + * @details Inputs: none + * @details Outputs: pendingACKOverride + * @param value override for pendingACKOverride + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testSetPendingACKOverride( U32 value ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + pendingACKOverride.ovData = value; + pendingACKOverride.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetPendingACKOverride function resets the override + * of the pendingACKOverride variable. + * @details Inputs: none + * @details Outputs: pendingACKOverride + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetPendingACKOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + pendingACKOverride.override = OVERRIDE_RESET; + pendingACKOverride.ovData = pendingACKOverride.ovInitData; + } + + return result; +} /**@}*/