Index: firmware/App/Modes/SalineBolus.c =================================================================== diff -u -r6896ebbd92bddef74bb8d26bfed92a0012e35a9a -r43648984725f44d6f73e20e1bf2e7ea44bc6e86b --- firmware/App/Modes/SalineBolus.c (.../SalineBolus.c) (revision 6896ebbd92bddef74bb8d26bfed92a0012e35a9a) +++ firmware/App/Modes/SalineBolus.c (.../SalineBolus.c) (revision 43648984725f44d6f73e20e1bf2e7ea44bc6e86b) @@ -10,6 +10,7 @@ #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Timers.h" +#include "TreatmentStop.h" #include "Valves.h" /** @@ -107,13 +108,6 @@ break; } - if ( TREATMENT_STOP_STATE == getTreatmentState() ) - { - // Only publish in exec if we are in treatment stop. In dialysis, the dialysis exec will publish itself - // otherwise there will be double publish - publishSalineBolusData( 0.0, 0.0, 0 ); - } - if ( priorSubState != currentSalineBolusState ) { setCurrent4thLevelState( (U32)currentSalineBolusState ); @@ -195,7 +189,8 @@ { rejReason = REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE; } - else if ( ( currTreatSubMode != TREATMENT_DIALYSIS_STATE ) && ( currTreatSubMode != TREATMENT_STOP_STATE ) ) + else if ( ( currTreatSubMode != TREATMENT_DIALYSIS_STATE ) && ( currTreatSubMode != TREATMENT_STOP_STATE ) && + ( TREATMENT_STOP_RECOVER_BLOOD_DETECT_STATE == getCurrentTreatmentStopState() ) ) { rejReason = REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE; } @@ -301,10 +296,7 @@ // Handle saline bolus start request from user if ( TRUE == salineBolusStartRequested ) { - if ( getTreatmentState() != TREATMENT_STOP_STATE ) - { - salineBolusStartRequested = FALSE; - } + salineBolusStartRequested = FALSE; // Cmd all pumps to stop setBloodPumpTargetFlowRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); @@ -395,11 +387,6 @@ result = SALINE_BOLUS_STATE_IDLE; } - if ( SALINE_BOLUS_STATE_IDLE == result ) - { - salineBolusStartRequested = FALSE; - } - // Are we stopping the bolus? if ( result != SALINE_BOLUS_STATE_IN_PROGRESS ) { @@ -409,8 +396,6 @@ // Send last saline bolus data salineBolusBroadcastTimerCtr = SALINE_BOLUS_DATA_PUB_INTERVAL; bolusSalineVolumeDelivered_mL = 0.0; - // Just pass the blood leak related as 0 since only saline bolus data is published - publishSalineBolusData( 0.0, 0.0, 0 ); sendTreatmentLogEventData( SALINE_BOLUSES_CHANGE_EVENT, bolusSalineVolumeDelivered_mL, totalSalineVolumeDelivered_mL ); }