Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -r29e42a928fa5f7498734dc0c95508ad1dde42d25 -reb9c877da08d5769b3c4599b2408e4a1dc4c8d93 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 29e42a928fa5f7498734dc0c95508ad1dde42d25) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision eb9c877da08d5769b3c4599b2408e4a1dc4c8d93) @@ -155,7 +155,7 @@ static void updateAlarmsSilenceStatus( void ); static void updateAlarmsFlags( void ); -static void clearAllRecoverableAlarms( ALARM_USER_ACTION_T action ); +static BOOL clearAllRecoverableAlarms( ALARM_USER_ACTION_T action ); static void resetAlarmPriorityFIFO( ALARM_PRIORITY_T priority ); static U32 getAlarmStartTime( ALARM_ID_T alarmID ); @@ -560,6 +560,8 @@ *************************************************************************/ void signalAlarmUserActionInitiated( ALARM_USER_ACTION_T action ) { + BOOL allRecAlarmsCleared = TRUE; + // Clear recoverable alarms on user action if ( ( action < NUMBER_OF_ALARM_USER_ACTIONS ) && ( action != ALARM_USER_ACTION_END_TREATMENT ) ) // end tx action must be confirmed first { @@ -575,20 +577,23 @@ // Otherwise we must be in mode/state where ack was only option - so clear all like other options else { - clearAllRecoverableAlarms( action ); + allRecAlarmsCleared = clearAllRecoverableAlarms( action ); } } else { - clearAllRecoverableAlarms( action ); + allRecAlarmsCleared = clearAllRecoverableAlarms( action ); } } // Initiate user selected action switch ( action ) { case ALARM_USER_ACTION_RESUME: - initiateAlarmAction( ALARM_ACTION_RESUME ); + if ( TRUE == allRecAlarmsCleared ) + { // only resume if we've cleared all recoverable alarms + initiateAlarmAction( ALARM_ACTION_RESUME ); + } break; case ALARM_USER_ACTION_RINSEBACK: @@ -1273,10 +1278,11 @@ * @details Inputs: ALARM_TABLE[] * @details Outputs: alarmNoRetrigger, alarmIsActive[] * @param action user action that prompted clearing of recoverable alarms - * @return none + * @return TRUE if all recoverable alarms cleared, FALSE if any left active *************************************************************************/ -static void clearAllRecoverableAlarms( ALARM_USER_ACTION_T action ) +static BOOL clearAllRecoverableAlarms( ALARM_USER_ACTION_T action ) { + BOOL result = TRUE; ALARM_ID_T a; // assigning to 1 in order to prevent ALARM_ID_NO_ALARM being cleared @@ -1288,7 +1294,7 @@ { // Clear alarm if active and condition not active if ( ( TRUE == alarmIsActive[ a ] ) && - ( ( TRUE == ALARM_TABLE[ a ].alarmConditionClearImmed ) || ( alarmIsDetected[ a ] != TRUE ) ) ) + ( ( TRUE == ALARM_TABLE[ a ].alarmConditionClearImmed ) || ( alarmIsDetected[ a ] != TRUE ) || ( action != ALARM_USER_ACTION_RESUME ) ) ) { // set no re-trigger flag if appropriate if ( ( ALARM_USER_ACTION_RINSEBACK == action ) && ( TRUE == ALARM_TABLE[ a ].alarmNoRetrigOnRB ) ) @@ -1313,8 +1319,14 @@ // clear this alarm clearAlarm( a ); } + else + { + result = FALSE; // we didn't clear this alarm because condition still active + } } } + + return result; } /*********************************************************************//**