Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r2c5f0db65f23016a42f3e28160c308336f2b108e --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 2c5f0db65f23016a42f3e28160c308336f2b108e) @@ -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 ); } } @@ -1155,4 +1155,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; +} /**@}*/