Index: AlarmMgmt.c =================================================================== diff -u -rca1d590217b1bfd14f0e0682f88e04de076ff199 -ref31ae5f4eb4f62b8c1b5cdc467507d8d0787640 --- AlarmMgmt.c (.../AlarmMgmt.c) (revision ca1d590217b1bfd14f0e0682f88e04de076ff199) +++ AlarmMgmt.c (.../AlarmMgmt.c) (revision ef31ae5f4eb4f62b8c1b5cdc467507d8d0787640) @@ -403,7 +403,30 @@ return result; } +/*********************************************************************//** + * @brief + * The getActiveAlarmCount function returns the count of currently active + * alarms by iterating the alarmIsActive array directly. + * @details \b Inputs: alarmIsActive[] + * @details \b Outputs: none + * @return Count of alarms currently active. + *************************************************************************/ +U32 getActiveAlarmCount( void ) +{ + 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; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/