Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -ra57994f752662abc0aaa8c2cf5c3af47ec2c5a20 -r949b386b5f58ab8bc534bd7e913ecb9f2c084c17 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision a57994f752662abc0aaa8c2cf5c3af47ec2c5a20) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 949b386b5f58ab8bc534bd7e913ecb9f2c084c17) @@ -411,13 +411,7 @@ broadcastData( MSG_ID_ALARM_CLEARED, COMM_BUFFER_OUT_CAN_HD_ALARM, (U08*)&data, sizeof( ALARM_ID_DATA_PUBLISH_T ) ); alarmIsActive[ alarm ] = FALSE; clearAlarmCondition( alarm ); - alarmStartedAt[ alarm ].data = 0; - // Clear FIFO if this alarm was in it - if ( alarmPriorityFIFO[ ALARM_TABLE[ alarm ].alarmPriority ].alarmID == alarm ) - { - resetAlarmPriorityFIFO( ALARM_TABLE[ alarm ].alarmPriority ); - } } } } @@ -685,11 +679,13 @@ U32 index; U32 activeAlarmListIndex = 0; + // Blank alarm list initially for ( index = 0; index < MAX_ALARM_LIST_SIZE; index++ ) { activeAlarmList[ index ] = ALARM_ID_NO_ALARM; } + // Fill alarm list from (up to) 10 highest priority active alarms if ( TRUE == isAnyAlarmActive() ) { for ( index = 0; index < NUM_OF_ALARM_IDS; index++ ) @@ -799,11 +795,17 @@ *************************************************************************/ static void updateAlarmsState( void ) { - ALARM_PRIORITY_T highestPriority = ALARM_PRIORITY_NONE; + ALARM_PRIORITY_T highestPriority = ALARM_PRIORITY_NONE, p; ALARM_ID_T a; BOOL faultsActive = FALSE; BOOL dialysateRecircBlocked = FALSE; BOOL bloodRecircBlocked = FALSE; + + // Reset priority FIFOs so we can re-determine them below + for ( p = ALARM_PRIORITY_NONE; p < NUM_OF_ALARM_PRIORITIES; p++ ) + { + resetAlarmPriorityFIFO( p ); + } // Update FIFOs and sub-ranks per active alarms table - for alarm ranking purposes to determine "top" alarm for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) @@ -814,7 +816,7 @@ U32 subRank = ALARM_TABLE[ a ].alarmSubRank; U32 msSinceTriggered = calcTimeSince( getAlarmStartTime( a ) ); - // See if this alarm is higher rank than highest active alarm in this priority category so far + // See if this alarm is higher rank than highest active alarm in this priority category so far (lower rank # = higher rank) if ( subRank <= alarmPriorityFIFO[ almPriority ].subRank ) { // If sub-rank is a tie, see which alarm was triggered first