Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r6fa37e66ea5aa6be96225821768c8cfd9be78a6a -r7959a737a00d914ccea0f2f3f3a6ddcbd82d6334 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 6fa37e66ea5aa6be96225821768c8cfd9be78a6a) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 7959a737a00d914ccea0f2f3f3a6ddcbd82d6334) @@ -297,23 +297,17 @@ /*********************************************************************//** * @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) - * @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 setDialysisBloodPumpFlowRate( U32 bPFlow ) { setBloodFlowRate = bPFlow; - 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 ) ) @@ -327,7 +321,32 @@ } #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 setDialysisDialInFlowAndUFRate( U32 dPFlow, F32 maxUFVol, F32 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; + #ifndef _RELEASE_ if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_DIALYSATE_INLET_PUMP_OPEN_LOOP ) ) { Index: firmware/App/Modes/Dialysis.h =================================================================== diff -u -r16b02389432724c1bd15e9ce58579bff95050a03 -r7959a737a00d914ccea0f2f3f3a6ddcbd82d6334 --- firmware/App/Modes/Dialysis.h (.../Dialysis.h) (revision 16b02389432724c1bd15e9ce58579bff95050a03) +++ firmware/App/Modes/Dialysis.h (.../Dialysis.h) (revision 7959a737a00d914ccea0f2f3f3a6ddcbd82d6334) @@ -55,7 +55,8 @@ void transitionToDialysis( void ); void execDialysis( void ); -void setDialysisParams( U32 bPFlow, U32 dPFlow, F32 maxUFVol, F32 uFRate ); +void setDialysisBloodPumpFlowRate( U32 bPFlow ); +void setDialysisDialInFlowAndUFRate( U32 dPFlow, F32 maxUFVol, F32 uFRate ); void stopDialysis( void ); void startHeparinPump( void ); Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -rbb648110d33fb859beed67fabc43f7e9614fc00a -r7959a737a00d914ccea0f2f3f3a6ddcbd82d6334 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision bb648110d33fb859beed67fabc43f7e9614fc00a) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 7959a737a00d914ccea0f2f3f3a6ddcbd82d6334) @@ -738,8 +738,9 @@ { lastTreatmentTimeStamp = getMSTimerCount(); // Kick dialysis sub-mode off - setDialysisParams( getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ), getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), - presMaxUFVolumeML, presUFRate ); + setDialysisBloodPumpFlowRate( getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ) ); + setDialysisDialInFlowAndUFRate( getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), presMaxUFVolumeML, presUFRate ); + if ( presUFRate > 0.0 ) { sendTreatmentLogEventData( UF_START_RESUME_EVENT, 0.0, presUFRate ); @@ -1037,7 +1038,8 @@ presTreatmentTimeSecs = treatmentTime * SEC_PER_MIN; setTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME, ( presMaxUFVolumeML / (F32)ML_PER_LITER ) ); setTreatmentParameterU32( TREATMENT_PARAM_TREATMENT_DURATION, ( presTreatmentTimeSecs / SEC_PER_MIN ) ); - setDialysisParams( getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ), getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), presMaxUFVolumeML, presUFRate ); + setDialysisBloodPumpFlowRate( getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ) ); + setDialysisDialInFlowAndUFRate( getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), presMaxUFVolumeML, presUFRate ); signalInitiatePressureStabilization( USE_NORMAL_STABILIZATION_PERIOD ); } else @@ -1221,8 +1223,8 @@ presUFRate = pendingUFRateChange; signalInitiatePressureStabilization( USE_NORMAL_STABILIZATION_PERIOD ); } - setDialysisParams( getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ), getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), - presMaxUFVolumeML, presUFRate ); + setDialysisBloodPumpFlowRate( getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ) ); + setDialysisDialInFlowAndUFRate( getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), presMaxUFVolumeML, presUFRate ); // If UF paused, resume with new settings if ( ( TREATMENT_DIALYSIS_STATE == currentTreatmentState ) &&