Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r26d736280fef713e7639cd2b98eed975e2eb4353 -raa4db7d76566ad7473f896e543f71fdbbc921ea9 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 26d736280fef713e7639cd2b98eed975e2eb4353) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision aa4db7d76566ad7473f896e543f71fdbbc921ea9) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2022 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file Dialysis.c * -* @author (last) Sean Nash -* @date (last) 12-Nov-2021 +* @author (last) Dara Navaei +* @date (last) 04-Jan-2022 * * @author (original) Sean * @date (original) 15-Jan-2020 @@ -26,6 +26,7 @@ #include "ModeTreatment.h" #include "ModeTreatmentParams.h" #include "OperationModes.h" +#include "Reservoirs.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Timers.h" @@ -191,6 +192,8 @@ // Inform DG interface that dialysis has started/resumed dialysisResumed(); + resetReservoirsVariables(); + // Set valves for dialysis setValvePosition( VDI, VALVE_POSITION_B_OPEN ); setValvePosition( VDO, VALVE_POSITION_B_OPEN ); @@ -1167,4 +1170,18 @@ resCurrVolume[ DG_RESERVOIR_2 ] = res2Vol; } +/*********************************************************************//** + * @brief + * The getReservoirUltrafiltrationVol function returns the ultrafiltration + * volume of a reservoir. + * @details Inputs: none + * @details Outputs: resStartVolume[], resFinalVolume[] + * @param reservoirID reservoir ID to calculate the ultrafiltration volume + * @return ultrafiltration volume of the reservoir + *************************************************************************/ +F32 getReservoirUltrafiltrationVol( DG_RESERVOIR_ID_T reservoirID ) +{ + return ( resFinalVolume[ reservoirID ] - resStartVolume[ reservoirID ] ); +} + /**@}*/