Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -r44a100f8e5210a02c23b8fcc4527d8e96d577381 -r8b793075edebe4a88faf7ec197c2ea154ac1e1b0 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 44a100f8e5210a02c23b8fcc4527d8e96d577381) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 8b793075edebe4a88faf7ec197c2ea154ac1e1b0) @@ -50,6 +50,9 @@ // *** This declaration will cause a compiler error if ALARM_TABLE does not have same # of alarms as the Alarm_List enumeration. U08 alarmTableSizeAssertion[ ( ( sizeof( ALARM_TABLE ) / sizeof( ALARM_T ) ) == NUM_OF_ALARM_IDS ? 1 : -1 ) ]; +// *** This declaration will cause a compiler error if ALARM_RANK_TABLE does not have same # of alarms as the Alarm_List enumeration. +U08 alarmRankTableSizeAssertion[ ( ( sizeof( ALARM_RANK_TABLE ) / sizeof( ALARM_RANK_T ) ) == NUM_OF_ALARM_IDS ? 1 : -1 ) ]; + /// A blank alarm data record for alarms that do not include alarm data when triggered. const ALARM_DATA_T BLANK_ALARM_DATA = { ALARM_DATA_TYPE_NONE, 0 }; @@ -632,22 +635,21 @@ 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 index; U32 activeAlarmListIndex = 0; - for ( i = 0; i < MAX_ALARM_LIST_SIZE; i++ ) + for ( index = 0; index < MAX_ALARM_LIST_SIZE; index++ ) { - activeAlarmList[ i ] = ALARM_ID_NO_ALARM; + activeAlarmList[ index ] = ALARM_ID_NO_ALARM; } if ( TRUE == isAnyAlarmActive() ) { - for ( alarmID = ALARM_ID_NO_ALARM; alarmID < NUM_OF_ALARM_IDS; alarmID++ ) + for ( index = 0; index < NUM_OF_ALARM_IDS; index++ ) { - if ( ( TRUE == alarmIsActive[ alarmID ] ) && ( activeAlarmListIndex < MAX_ALARM_LIST_SIZE ) ) + if ( ( TRUE == isAlarmActive( ALARM_RANK_TABLE[ index ].alarmID ) ) && ( activeAlarmListIndex < MAX_ALARM_LIST_SIZE ) ) { - activeAlarmList[ activeAlarmListIndex ] = alarmID; + activeAlarmList[ activeAlarmListIndex ] = ALARM_RANK_TABLE[ index ].alarmID; activeAlarmListIndex++; } }