Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r239f565516c73aae797288effcfdf1fca0a361a0 -rec4a8156ebdaf7396a0242addacfa01439d8a38e --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 239f565516c73aae797288effcfdf1fca0a361a0) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision ec4a8156ebdaf7396a0242addacfa01439d8a38e) @@ -100,7 +100,7 @@ static volatile BOOL dgIsOnlyCANNode = TRUE; ///< flag indicating whether DG is alone on CAN bus. static U32 canXmitRetryCtr = 0; ///< counter for CAN transmit retries. -static volatile BOOL hdIsCommunicating = FALSE; ///< has HD sent a message since last check +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 // ********** private function prototypes ********** @@ -153,7 +153,7 @@ *************************************************************************/ BOOL isHDCommunicating( void ) { - return hdIsCommunicating; + return getU32OverrideValue(&hdCommunicationStatus); } /*********************************************************************//** @@ -496,7 +496,7 @@ // if message from HD broadcast channel, update HD comm status if ( COMM_BUFFER_IN_CAN_HD_BROADCAST == MSG_IN_BUFFERS[ i ] ) { - hdIsCommunicating = TRUE; + hdCommunicationStatus.data = TRUE; timeOfLastHDCheckIn = getMSTimerCount(); } } @@ -654,7 +654,7 @@ { if ( TRUE == didTimeout( timeOfLastHDCheckIn, HD_COMM_TIMEOUT_IN_MS ) ) { - hdIsCommunicating = FALSE; + hdCommunicationStatus.data = FALSE; //activateAlarmNoData( ALARM_ID_HD_COMM_TIMEOUT ); } } @@ -1172,4 +1172,50 @@ } } + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + +/*********************************************************************//** + * @brief + * The testSetHDCommunicationStatus function sets the override + * of the HD communication status. + * @details Inputs: none + * @details Outputs: hdCommunicationStatus + * @return TRUE if reset successful, FALSE if not + *************************************************************************/ +BOOL testSetHDCommunicationStatus( void ) +{ + BOOL result = FALSE; + if(TRUE == isTestingActivated() ) + { + result = TRUE; + hdCommunicationStatus.ovData = TRUE; + hdCommunicationStatus.override = OVERRIDE_KEY; + + } + return result; +} + +/*********************************************************************//** + * @brief + * The testResetHDCommuncationStatus function resets the override + * of the HD communication status. + * @details Inputs: none + * @details Outputs: hdCommunicationStatus + * @return TRUE if reset successful, FALSE if not + *************************************************************************/ +BOOL testResetHDCommuncationStatus( void ) +{ + BOOL result = FALSE; + if(TRUE == isTestingActivated() ) + { + result = TRUE; + hdCommunicationStatus.override = OVERRIDE_RESET; + hdCommunicationStatus.ovData = hdCommunicationStatus.ovInitData; + + } + return result; +} /**@}*/