Index: AlarmMgmt.c =================================================================== diff -u -ref31ae5f4eb4f62b8c1b5cdc467507d8d0787640 -r4aab00e6bcb5c9e807f3006b3aa9a8fdcc073232 --- AlarmMgmt.c (.../AlarmMgmt.c) (revision ef31ae5f4eb4f62b8c1b5cdc467507d8d0787640) +++ AlarmMgmt.c (.../AlarmMgmt.c) (revision 4aab00e6bcb5c9e807f3006b3aa9a8fdcc073232) @@ -405,28 +405,18 @@ /*********************************************************************//** * @brief - * The getActiveAlarmCount function returns the count of currently active - * alarms by iterating the alarmIsActive array directly. - * @details \b Inputs: alarmIsActive[] + * The getAlarmSource function returns the source subsystem of the given alarm. + * @details \b Inputs: ALARM_TABLE[] * @details \b Outputs: none - * @return Count of alarms currently active. + * @param alarm ID of alarm to get the source. + * @return Source subsystem of the given alarm. *************************************************************************/ -U32 getActiveAlarmCount( void ) +ALARM_SOURCE_T getAlarmSource( ALARM_ID_T alarm ) { - U32 count = 0U; - ALARM_ID_T alarm; - - for ( alarm = (ALARM_ID_T)1; alarm < NUM_OF_ALARM_IDS; alarm++ ) - { - if ( TRUE == alarmIsActive[ alarm ] ) - { - count++; - } - } - - return count; + return getAlarmProperties( alarm ).alarmSource; } + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: AlarmMgmt.h =================================================================== diff -u -ref31ae5f4eb4f62b8c1b5cdc467507d8d0787640 -r4aab00e6bcb5c9e807f3006b3aa9a8fdcc073232 --- AlarmMgmt.h (.../AlarmMgmt.h) (revision ef31ae5f4eb4f62b8c1b5cdc467507d8d0787640) +++ AlarmMgmt.h (.../AlarmMgmt.h) (revision 4aab00e6bcb5c9e807f3006b3aa9a8fdcc073232) @@ -120,7 +120,7 @@ BOOL isAlarmConditionDetected( ALARM_ID_T alarm ); BOOL isAlarmRecoverable( ALARM_ID_T alarm ); -U32 getActiveAlarmCount( void ); +ALARM_SOURCE_T getAlarmSource( ALARM_ID_T alarm ); BOOL testAlarmStateOverride( MESSAGE_T *message );