Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rfa356a2bce909141f45c6832659fa1ceea5bfbba -r49dba1e95bb3763b4c150e7a80b84a65264a7ca8 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision fa356a2bce909141f45c6832659fa1ceea5bfbba) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 49dba1e95bb3763b4c150e7a80b84a65264a7ca8) @@ -192,7 +192,12 @@ { // No need to do anything if alarm is already active if ( FALSE == alarmIsActive[ alarm ] ) - { + { + // If alarm status was that no alarms currently active, set this alarm as top alarm until status formally updated later + if ( ALARM_ID_NO_ALARM == alarmStatus.alarmTop ) + { + alarmStatus.alarmTop = alarm; + } // If alarms silenced, end silence due to new alarm alarmStatus.alarmsSilenced = FALSE; // If alarm is a fault, request transition to fault mode @@ -527,6 +532,21 @@ /*********************************************************************//** * @brief + * The isAnyAlarmActive function determines whether any alarm is currently + * active. + * @details Inputs: alarmStatus + * @details Outputs: none + * @return TRUE if any alarm is active, FALSE if not + *************************************************************************/ +BOOL isAnyAlarmActive( void ) +{ + BOOL result = ( alarmStatus.alarmTop != ALARM_ID_NO_ALARM ? TRUE : FALSE ); + + return result; +} + +/*********************************************************************//** + * @brief * The getCurrentAlarmStatePriority function determines the current alarm * state priority (NONE, LOW, MEDIUM, or HIGH). * @details Inputs: alarmStatus