Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r16c791301d13ab6517185c84cb00db53fe16564b -rfe3a4b13527ae0cdd2377d9c8971bc541979e2d5 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 16c791301d13ab6517185c84cb00db53fe16564b) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision fe3a4b13527ae0cdd2377d9c8971bc541979e2d5) @@ -76,6 +76,9 @@ /// Interval (in task intervals) at which to publish standby mode data to CAN bus. static OVERRIDE_U32_T standbyModePublishInterval = { DISINFECTS_DATA_PUB_INTERVAL, DISINFECTS_DATA_PUB_INTERVAL, DISINFECTS_DATA_PUB_INTERVAL, 0 }; +static const U32 SERVICE_TIME_INTERVAL_S = (U32)( 365 * 0.5 * SECONDS_IN_A_DAY ); ///< HD/DG 6-month service interval in seconds. +static BOOL homingInitiated; ///< Flag indicates actuator homing has been initiated from standby mode. + // ********** private function prototypes ********** static HD_STANDBY_STATE_T handleStandbyModeStartState( void ); Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rb217ec210cf9c731871b2828f404d877830b25cb -rfe3a4b13527ae0cdd2377d9c8971bc541979e2d5 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision b217ec210cf9c731871b2828f404d877830b25cb) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision fe3a4b13527ae0cdd2377d9c8971bc541979e2d5) @@ -260,6 +260,33 @@ /*********************************************************************//** * @brief + * The isACPowerLost function determines whether A/C power loss has + * been detected. This function sets the alarms blocked condition to + * allow smooth alarm recovery. + * + * @details Inputs: alarmStatus + * @details Outputs: alarmsBlockedTimer + * @return TRUE if A/C power loss alarm is in effect, FALSE if not + *************************************************************************/ +BOOL isACPowerLost( void ) +{ + BOOL result = TRUE; + + // Continue to block new alarms until the alarms are cleared. + if ( ( FALSE == isAlarmConditionDetected( ALARM_ID_HD_AC_POWER_LOST ) ) && + ( FALSE == isAlarmConditionDetected( ALARM_ID_HD_AC_POWER_LOST_IN_TREATMENT ) ) ) + { + result = FALSE; + } + else + { + alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; + } + return result; +} + +/*********************************************************************//** + * @brief * The activateAlarm function activates a given alarm. * @details Inputs: none * @details Outputs: alarmIsActive[], alarmStartedAt[], alarmStatus is updated @@ -268,6 +295,11 @@ *************************************************************************/ static void activateAlarm( ALARM_ID_T alarm ) { + // Block new alarms, occuring during loss of AC power + if ( ( TRUE == getCPLDACPowerLossDetected() ) ) + { + alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; + } // Verify valid alarm index if ( ( alarm > ALARM_ID_NO_ALARM ) && ( alarm < NUM_OF_ALARM_IDS ) ) {