Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r6fa37e66ea5aa6be96225821768c8cfd9be78a6a -r46e15981a836f5c96399fd684f06892c2c15cb6b --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 6fa37e66ea5aa6be96225821768c8cfd9be78a6a) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 46e15981a836f5c96399fd684f06892c2c15cb6b) @@ -297,47 +297,66 @@ /*********************************************************************//** * @brief - * The setDialysisParams function sets the dialysis treatment parameters. + * 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 one or more parameters during treatment. + * and when the user changes the blood flow rate during treatment. * @details Inputs: none * @details Outputs: dialysis treatment parameters are set. * @param bPFlow target blood pump flow rate (in mL/min) + * @return none + *************************************************************************/ +void setDialysisBloodPumpFlowRate( U32 bPFlow ) +{ + setBloodFlowRate = bPFlow; + + // Make rate changes in real time if currently performing dialysis. + if ( ( TREATMENT_DIALYSIS_STATE == getTreatmentState() ) && ( getDialysisState() != DIALYSIS_SALINE_BOLUS_STATE ) ) + { + PUMP_CONTROL_MODE_T mode = PUMP_CONTROL_MODE_CLOSED_LOOP; + +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_BLOOD_PUMP_OPEN_LOOP ) ) + { + mode = PUMP_CONTROL_MODE_OPEN_LOOP; + } +#endif + setBloodPumpTargetFlowRate( setBloodFlowRate, MOTOR_DIR_FORWARD, mode ); + } +} + +/*********************************************************************//** + * @brief + * The setDialysisDialInFlowAndUFRate function sets the dialysis treatment parameters. + * This function should be called prior to beginning dialysis treatment + * and when the user changes any one of the parameters during treatment. + * @details Inputs: none + * @details Outputs: dialysis treatment parameters are set. * @param dPFlow target dialysate inlet pump flow rate (in mL/min) * @param maxUFVol maximum ultrafiltration volume (in mL) * @param uFRate target ultrafiltration rate (in mL/min) * @return none *************************************************************************/ -void setDialysisParams( U32 bPFlow, U32 dPFlow, F32 maxUFVol, F32 uFRate ) +void setDialysisDialInFlowAndUFRate( U32 dPFlow, F32 maxUFVol, F32 uFRate ) { - setBloodFlowRate = bPFlow; - setDialysateFlowRate = dPFlow; - setUFVolumeML = maxUFVol; - setUFRate = uFRate; + setDialysateFlowRate = dPFlow; + setUFVolumeML = maxUFVol; + setUFRate = uFRate; - // Make rate changes in real time if currently performing dialysis. - if ( ( TREATMENT_DIALYSIS_STATE == getTreatmentState() ) && ( getDialysisState() != DIALYSIS_SALINE_BOLUS_STATE ) ) - { - PUMP_CONTROL_MODE_T mode = PUMP_CONTROL_MODE_CLOSED_LOOP; + // Make rate changes in real time if currently performing dialysis. + if ( ( TREATMENT_DIALYSIS_STATE == getTreatmentState() ) && ( getDialysisState() != DIALYSIS_SALINE_BOLUS_STATE ) ) + { + PUMP_CONTROL_MODE_T mode = PUMP_CONTROL_MODE_CLOSED_LOOP; #ifndef _RELEASE_ - if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_BLOOD_PUMP_OPEN_LOOP ) ) - { - mode = PUMP_CONTROL_MODE_OPEN_LOOP; - } + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_DIALYSATE_INLET_PUMP_OPEN_LOOP ) ) + { + mode = PUMP_CONTROL_MODE_OPEN_LOOP; + } #endif - setBloodPumpTargetFlowRate( setBloodFlowRate, MOTOR_DIR_FORWARD, mode ); + setDialInPumpTargetFlowRate( setDialysateFlowRate, MOTOR_DIR_FORWARD, mode ); -#ifndef _RELEASE_ - if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_DIALYSATE_INLET_PUMP_OPEN_LOOP ) ) - { - mode = PUMP_CONTROL_MODE_OPEN_LOOP; - } -#endif - setDialInPumpTargetFlowRate( setDialysateFlowRate, MOTOR_DIR_FORWARD, mode ); - - setDialOutPumpTargetRate( setDialysateFlowRate + (S32)setUFRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); - } + setDialOutPumpTargetRate( setDialysateFlowRate + (S32)setUFRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + } } /*********************************************************************//**