Index: firmware/App/Modes/SalineBolus.c =================================================================== diff -u -rd8e44751b74daf5ec4723ddbf30614b2e01fcced -r6896ebbd92bddef74bb8d26bfed92a0012e35a9a --- firmware/App/Modes/SalineBolus.c (.../SalineBolus.c) (revision d8e44751b74daf5ec4723ddbf30614b2e01fcced) +++ firmware/App/Modes/SalineBolus.c (.../SalineBolus.c) (revision 6896ebbd92bddef74bb8d26bfed92a0012e35a9a) @@ -107,6 +107,13 @@ 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 ); @@ -229,7 +236,7 @@ { rejReason = REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE; } - else if ( currTreatSubMode != TREATMENT_DIALYSIS_STATE ) + else if ( ( currTreatSubMode != TREATMENT_DIALYSIS_STATE ) && ( currTreatSubMode != TREATMENT_STOP_STATE ) ) { rejReason = REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE; } @@ -334,6 +341,8 @@ setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); // Switch to saline bag setValvePosition( VBA, VALVE_POSITION_C_CLOSE ); + // Set to patient in case VBV is closed in treatment stop + setValvePosition( VBV, VALVE_POSITION_B_OPEN ); // Start blood pump at saline bolus rate setBloodPumpTargetFlowRate( SALINE_BOLUS_FLOW_RATE, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); // Start dialysate inlet pump at re-circ rate