Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rb90c3887b95a6eee7f8014ff478f204ed8a5211c -raa1367aa813db6acc52013795a8c6e58405bb10e --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision b90c3887b95a6eee7f8014ff478f204ed8a5211c) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision aa1367aa813db6acc52013795a8c6e58405bb10e) @@ -56,6 +56,7 @@ #define MAX_FPGA_CLOCK_SPEED_ERRORS 3 ///< maximum number of FPGA clock speed errors within window period before alarm #define MAX_FPGA_CLOCK_SPEED_ERROR_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< FPGA clock speed error window +#define PENDING_ACK_LIST_OVERRIDE_HD_CHANNEL 1 ///< Value for determining UI or DG channel when Pending ACKs are overriden. #pragma pack(push, 1) /// Record for transmitted message that is pending acknowledgement from receiver. @@ -106,6 +107,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 +782,8 @@ { 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 ) { @@ -1368,6 +1371,10 @@ handleTestDGRAMStatusOverrideRequest( message ); break; + case MSG_ID_DG_CAN_RECEIVE_ACK_MESSAGE_OVERRIDE: + handleTestDGPendingACKOverrideRequest( message ); + break; + default: // TODO - unrecognized message ID received - ignore break; @@ -1425,4 +1432,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; +} /**@}*/