Index: firmware/App/Modes/StateTxDialysis.c =================================================================== diff -u -ra1f14a4e422f94b6bc25d1b91839761e7e1196d7 -r95c81a7d81fa3e6534bcf2e35e1d9b1eba26e372 --- firmware/App/Modes/StateTxDialysis.c (.../StateTxDialysis.c) (revision a1f14a4e422f94b6bc25d1b91839761e7e1196d7) +++ firmware/App/Modes/StateTxDialysis.c (.../StateTxDialysis.c) (revision 95c81a7d81fa3e6534bcf2e35e1d9b1eba26e372) @@ -224,14 +224,36 @@ setBloodFlowRate = bPFlow; // Make rate changes in real time if currently performing dialysis. - if ( TREATMENT_DIALYSIS_STATE == getTreatmentState() ) + if ( TREATMENT_DIALYSIS_STATE == getTreatmentState() || (TREATMENT_END_STATE==getTreatmentState() )) { setBloodPumpTargetFlowRate( setBloodFlowRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); } } + /*********************************************************************//** * @brief + * The setDialysisBloodPumpFlowRate function sets the blood pump flow rate parameter. + * This function should be called prior to beginning dialysis treatment + * and when the user changes the blood flow rate during treatment. + * @details \b Inputs: none + * @details \b Outputs: setBloodFlowRate + * @param bPFlow target blood pump flow rate (in mL/min) + * @return none + *************************************************************************/ +void setDialysisBloodPumpFlowRateEndTx( U32 bPFlow ) +{ + setBloodFlowRate = bPFlow; + + // Make rate changes in real time if currently performing dialysis. + if ( (TREATMENT_END_STATE == getTreatmentState() )) + { + setBloodPumpTargetFlowRate( setBloodFlowRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + } +} + +/*********************************************************************//** + * @brief * The setDialysisDDParams function sets the dialysate rate and ultrafiltration * volume and rate parameters. * @details \b Inputs: none