Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r119a24b1a48dc9d96c43f90244a0aeedd34a4408 -r150a74dc4d92472352d14934b4359c4bf7e7450a --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 119a24b1a48dc9d96c43f90244a0aeedd34a4408) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 150a74dc4d92472352d14934b4359c4bf7e7450a) @@ -7,8 +7,8 @@ * * @file SystemComm.c * -* @author (last) James Walter Taylor -* @date (last) 16-Aug-2023 +* @author (last) Michael Garthwaite +* @date (last) 21-Aug-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -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 ********** @@ -781,7 +782,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 ) { @@ -1373,6 +1374,14 @@ handleTestDGRAMStatusOverrideRequest( message ); break; + case MSG_ID_DG_RESERVOIR_BROADCAST_INTERVAL_OVERRIDE: + handleTestDGReservoirOverrideRequest( message ); + break; + + case MSG_ID_DG_CAN_RECEIVE_ACK_MESSAGE_OVERRIDE: + handleTestDGPendingACKOverrideRequest( message ); + break; + default: // TODO - unrecognized message ID received - ignore break; @@ -1430,4 +1439,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; +} /**@}*/