Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rc8e9a8d78c51b889bba3b8ce9e7da1a0c661f771 -rbe587eebf8193ff2a1864b7da9012ca410588ce1 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision c8e9a8d78c51b889bba3b8ce9e7da1a0c661f771) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision be587eebf8193ff2a1864b7da9012ca410588ce1) @@ -41,15 +41,14 @@ /// Interval (ms/task time) at which the alarm information is published on the CAN bus. #define ALARM_INFO_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) -/// Interval (ms/task time) at which the alarm information is published on the CAN bus. +/// Interval (ms/task time) Alarms are blocked after the return of AC power. #define ALARM_BLOCKED_COUNT_AFTER_AC_RETURN ( 10*MS_PER_SECOND / TASK_GENERAL_INTERVAL ) #define ALARM_SILENCE_EXPIRES_IN_SECS (60) ///< Alarm silence expiration time in seconds. #define SUPERVISOR_ALARM_KEY 0xD2C3B4A5 ///< 32-bit key required for clear all alarms request. #define LOWEST_ALARM_SUB_RANK 999 ///< Lowest alarm sub-rank that can be set. -#define ALARM_BLOCKED_LIMIT_AC_RECOVERY 0 ///< Alarm rank limit, alarms at and above this limit are blocked by alarmStatus.alarmsBlockedTimer (all alarms blocked == 0) #define ALARM_NOT_BLOCKED 0 ///< Alarm blocked timer value that indicates no alarm block // *** This declaration will cause a compiler error if ALARM_TABLE does not have same # of alarms as the Alarm_List enumeration. @@ -115,6 +114,7 @@ static OVERRIDE_U32_T alarmStartedAt[ NUM_OF_ALARM_IDS ]; ///< Table - when alarm became active for each alarm (if active) or zero (if inactive) static U32 alarmStatusPublicationTimerCounter = 0; ///< Used to schedule alarm status publication to CAN bus. static U32 alarmInfoPublicationTimerCounter = 0; ///< Used to schedule alarm information publication to CAN bus. +static U32 alarmsBlockedTimer = 0; ///< Countdown timer used to temporarily block new alarms from being initiated /// Interval (in task intervals) at which to publish alarm status to CAN bus. static OVERRIDE_U32_T alarmStatusPublishInterval = { ALARM_STATUS_PUBLISH_INTERVAL, ALARM_STATUS_PUBLISH_INTERVAL, ALARM_STATUS_PUBLISH_INTERVAL, 0 }; @@ -202,7 +202,6 @@ alarmStatus.alarmsSilenced = FALSE; alarmStatus.alarmsSilenceStart = 0; alarmStatus.alarmsSilenceExpiresIn = 0; - alarmStatus.alarmsBlockedTimer = 0; alarmStatus.alarmsEscalatesIn = 0; alarmStatus.alarmsToEscalate = FALSE; alarmStatus.alarmTop = ALARM_ID_NO_ALARM; @@ -218,6 +217,7 @@ alarmStatus.noDialRecirc = FALSE; alarmStatus.ok = FALSE; + alarmsBlockedTimer = 0; alarmAudioTestToneRequested = FALSE; resumeBlockedByAlarmProperty = FALSE; alarmAudioSelfTestState = ALARM_AUDIO_SELF_TEST_STATE_START; @@ -242,9 +242,9 @@ publishAlarmInfo(); // Block new machine alarms during power fail recovery - if ( alarmStatus.alarmsBlockedTimer > 0 ) + if ( alarmsBlockedTimer > 0 ) { - alarmStatus.alarmsBlockedTimer--; + alarmsBlockedTimer--; } } @@ -341,7 +341,7 @@ * The activateAlarm2Data function activates a given alarm. Also, an alarm * message is broadcast to the rest of the system. This function will * include two given data in the broadcast message for logging. - * @details Inputs: none + * @details Inputs: alarmsBlockedTimer, determines blocked alarm conditions * @details Outputs: alarm triggered message sent, alarm activated * @param alarm ID of alarm to activate * @param alarmData1 supporting data to include in alarm msg @@ -350,16 +350,18 @@ *************************************************************************/ void activateAlarm2Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData1, ALARM_DATA_T alarmData2 ) { - // Verify valid alarm index + // Block if new alarms are occur during loss of AC power + if ( ( TRUE == getCPLDACPowerLossDetected() ) ) + { + alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; + } + // Sanity check, verify valid alarm index if ( ( alarm > ALARM_ID_NO_ALARM ) && ( alarm < NUM_OF_ALARM_IDS ) ) { - // Block if new alarms are occur during loss of AC power - if ( ( TRUE == getCPLDACPowerLossDetected() ) ) - { - alarmStatus.alarmsBlockedTimer = ALARM_BLOCKED_COUNT_AFTER_AC_RETURN; - } // if the block timer is 0 OR we have an unblockable alarm - if ( ( ALARM_NOT_BLOCKED == alarmStatus.alarmsBlockedTimer ) ) + if ( ( ALARM_NOT_BLOCKED == alarmsBlockedTimer ) + || ( ALARM_ID_HD_AC_POWER_LOST == alarm ) + || ( ALARM_ID_HD_AC_POWER_LOST_IN_TREATMENT == alarm ) ) { // Broadcast alarm and data if alarm not already active if ( FALSE == alarmIsActive[ alarm ] )