Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -red6e1e131ccb7a9a586cfb766ea270fc3cbdc1c9 -r050cc33f4556e1a6b928ea90f6d95387505df73d --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision ed6e1e131ccb7a9a586cfb766ea270fc3cbdc1c9) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 050cc33f4556e1a6b928ea90f6d95387505df73d) @@ -71,7 +71,6 @@ static COMP_ALARM_STATUS_T alarmStatus; ///< Record for the current composite alarm status. static ALARM_PRIORITY_RANKS_T alarmPriorityFIFO[ NUM_OF_ALARM_PRIORITIES ]; ///< FIFO - first activated or highest sub-rank alarm in each alarm priority category. -static U32 activeAlarmList[ MAX_ALARM_LIST_SIZE ]; ///< List of active alarms. static BOOL alarmUserRecoveryActionEnabled[ NUMBER_OF_ALARM_USER_ACTIONS ]; ///< Alarm user recovery actions enabled flags. @@ -106,7 +105,6 @@ { ALARM_PRIORITY_T p; ALARM_ID_T a; - U32 i; // Disable backup audio CLR_BACKUP_AUDIO_ENABLE(); @@ -127,11 +125,6 @@ alarmPriorityFIFO[ p ].alarmID = ALARM_ID_NO_ALARM; alarmPriorityFIFO[ p ].subRank = LOWEST_ALARM_SUB_RANK; alarmPriorityFIFO[ p ].timeSinceTriggeredMS = 0; - } - // Initialize active alarm list - for ( i = 0; i < MAX_ALARM_LIST_SIZE; i++ ) - { - activeAlarmList[ i ] = ALARM_ID_NO_ALARM; } // Initialize composite alarm state alarmStatus.alarmsState = ALARM_PRIORITY_NONE; @@ -590,15 +583,36 @@ * @brief * The handleActiveAlarmListRequest function processed the active alarms list * request from UI. -* @details Inputs: activeAlarmList +* @details Inputs: alarmIsActive[] * @details Outputs: sent active alarms list to UI * @return none *************************************************************************/ void handleActiveAlarmListRequest( void ) { BOOL accepted = TRUE; REQUEST_REJECT_REASON_CODE_T rejReason = REQUEST_REJECT_REASON_NONE; + U32 activeAlarmList[ MAX_ALARM_LIST_SIZE ]; + U32 i; + ALARM_ID_T alarmID; + U32 activeAlarmListIndex = 0; + for ( i = 0; i < MAX_ALARM_LIST_SIZE; i++ ) + { + activeAlarmList[ i ] = ALARM_ID_NO_ALARM; + } + + if ( TRUE == isAnyAlarmActive() ) + { + for ( alarmID = ALARM_ID_NO_ALARM; alarmID < NUM_OF_ALARM_IDS; alarmID++ ) + { + if ( ( TRUE == alarmIsActive[ alarmID ] ) && ( activeAlarmListIndex < MAX_ALARM_LIST_SIZE ) ) + { + activeAlarmList[ activeAlarmListIndex ] = alarmID; + activeAlarmListIndex++; + } + } + } + sendActiveAlarmsList( accepted, rejReason, activeAlarmList, sizeof( activeAlarmList ) ); }