Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r8ea2ea3096334f18a1bd38018bc4359e16374d83 -r66cc826068b54bc436cde0fae70a05ba6c1ac974 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 8ea2ea3096334f18a1bd38018bc4359e16374d83) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 66cc826068b54bc436cde0fae70a05ba6c1ac974) @@ -8,7 +8,7 @@ * @file SystemComm.c * * @author (last) Dara Navaei -* @date (last) 22-Feb-2022 +* @date (last) 31-Mar-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -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 = (U32)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 ); } } @@ -1153,6 +1153,14 @@ handleTestFansRPMAlarmStartTimeOffsetRequest( message ); break; + case MSG_ID_DG_USED_ACID_VOLUME_ML_OVERRIDE: + handleTestUsedAcidVolumeMLOverrideRequest( message ); + break; + + case MSG_ID_DG_USED_BICARB_VOLUME_ML_OVERRIDE: + handleTestUsedBicarbVolumeMLOverrideRequest( message ); + break; + case MSG_ID_DG_GET_SW_CONFIG_RECORD: handleGetDGSoftwareConfigRecord( message ); break; @@ -1165,11 +1173,64 @@ handleSetFansDutyCycleOverrideRequest( message ); break; + case MSG_ID_DG_HD_COMMUNICATION_STATUS_OVERRIDE: + handleTestHDCommunicationStatusOverrideRequest( message ); + break; + default: // TODO - unrecognized message ID received - ignore break; } } } + +/************************************************************************* + * 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( U32 value ) +{ + BOOL result = FALSE; + + if (TRUE == isTestingActivated() ) + { + result = TRUE; + hdCommunicationStatus.ovData = value; + 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; +} + /**@}*/