Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rb44dcc02837655219c4ce3a0ec154342674f506b -r071030fb2a5a44a8bb10856361211689d48d8dee --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision b44dcc02837655219c4ce3a0ec154342674f506b) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 071030fb2a5a44a8bb10856361211689d48d8dee) @@ -1383,6 +1383,9 @@ if ( ( TRUE == alarmIsActive[ a ] ) && ( ( TRUE == ALARM_TABLE[ a ].alarmConditionClearImmed ) || ( alarmIsDetected[ a ] != TRUE ) || ( action != ALARM_USER_ACTION_RESUME ) ) ) { + HD_OP_MODE_T mode = getCurrentOperationMode(); + U32 sub = getCurrentSubMode(); + // set no re-trigger flag if appropriate if ( ( ALARM_USER_ACTION_RINSEBACK == action ) && ( TRUE == ALARM_TABLE[ a ].alarmNoRetrigOnRB ) ) { // alarms with no re-trigger on rinseback property should set the no re-trigger flag @@ -1396,15 +1399,32 @@ { if ( ( TRUE == ALARM_TABLE[ a ].alarmNoResume ) && ( TRUE == ALARM_TABLE[ a ].alarmNoRinseback ) ) { // alarms that only allow end-tx that occur in rinseback or recirc states of treatment mode should set the no re-trigger flag - if ( ( MODE_TREA == getCurrentOperationMode() ) && - ( ( TREATMENT_RINSEBACK_STATE == getCurrentSubMode() ) || ( TREATMENT_RECIRC_STATE == getCurrentSubMode() ) ) ) + if ( ( MODE_TREA == mode ) && ( ( TREATMENT_RINSEBACK_STATE == sub ) || ( TREATMENT_RECIRC_STATE == sub ) ) ) { alarmNoRetrigger = TRUE; } } } - // clear this alarm - clearAlarm( a ); + // check special cases where we do not want to clear this alarm - otherwise, clear it + if ( ( ALARM_ID_DG_CREATING_DIALYSATE_PLEASE_WAIT == a ) && ( TRUE == alarmIsDetected[ a ] ) && ( mode != MODE_POST ) && + ( action != ALARM_USER_ACTION_RINSEBACK ) && ( action != ALARM_USER_ACTION_END_TREATMENT ) ) + { + // do not clear this alarm if condition not cleared first (unless treatment is over) + result = FALSE; + } + else if ( ( ( ALARM_ID_DG_FILL_CONDUCTIVITY_OUT_OF_RANGE == a ) || + ( ALARM_ID_DG_ACID_BOTTLE_LOW_VOLUME == a ) || + ( ALARM_ID_DG_BICARB_BOTTLE_LOW_VOLUME == a ) ) && + ( alarmStatus.alarmTop != a ) ) + { + // do not clear this alarm unless it is top (user is specifically clearing this alarm) + result = FALSE; + } + else + { + // clear this alarm + clearAlarm( a ); + } } else if ( TRUE == alarmIsActive[ a ] ) {