Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r438b848d9190fd4212a7ed1b949fabf5cab78659 -red4f6eb9692ea0f5f9cb7acae1cf119932fb2d72 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 438b848d9190fd4212a7ed1b949fabf5cab78659) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision ed4f6eb9692ea0f5f9cb7acae1cf119932fb2d72) @@ -81,7 +81,7 @@ static U32 setBloodFlowRate; ///< Currently set blood flow rate (from prescription). static U32 setDialysateFlowRate; ///< Currently set dialysate flow rate (from prescription). -static F32 maxUFVolumeML; ///< Currently set total ultrafiltration volume for treatment (from prescription). +static F32 setUFVolumeML; ///< Currently set total ultrafiltration volume for treatment (from prescription). static F32 setUFRate; ///< Currently set ultrafiltration rate (from prescription). static U32 salineBolusBroadcastTimerCtr; ///< Saline bolus data broadcast timer counter used to schedule when to transmit data. @@ -142,7 +142,7 @@ setBloodFlowRate = 0; setDialysateFlowRate = 0; - maxUFVolumeML = 0.0; + setUFVolumeML = 0.0; setUFRate = 0.0; salineBolusBroadcastTimerCtr = 0; @@ -307,7 +307,7 @@ { setBloodFlowRate = bPFlow; setDialysateFlowRate = dPFlow; - maxUFVolumeML = maxUFVol; + setUFVolumeML = maxUFVol; setUFRate = uFRate; // Make rate changes in real time if currently performing dialysis. @@ -806,7 +806,7 @@ updateReservoirUFTime(); // If we have reached target UF volume, UF is complete - set UF rate to zero for remainder of treatment - if ( refUFVolume >= maxUFVolumeML ) + if ( refUFVolume >= setUFVolumeML ) // TODO - is this something we want to do or should we just let UF continue? { setUFRate = 0.0; } @@ -1061,11 +1061,10 @@ /*********************************************************************//** * @brief - * The updateUFVolumes function updates the ultrafiltration volumes based on - * set UF rate, latest UF elapsed time, and the latest load cell weight for the - * currently used reservoir. Updated UF volumes are then sent to the dialysate - * outlet pump controller. - * @details Inputs: setUFRate, uFTimeMS, load cell weight + * The updateUFVolumes function updates the measured ultrafiltration volume based on + * the latest load cell weight for the currently used reservoir. Updated UF volumes + * are then sent to the dialysate outlet pump controller. + * @details Inputs: measUFVolumeFromPriorReservoirs, resStartVolume[], load cell weight * @details Outputs: refUFVolume, measUFVolume * @return none *************************************************************************/