Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -rb5ba71b747694b4c19b276b0ca00b0fb954056c9 -rcd5be724d5a3ba7457e761191d82f278654d7f5c --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision b5ba71b747694b4c19b276b0ca00b0fb954056c9) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision cd5be724d5a3ba7457e761191d82f278654d7f5c) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2024 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 ModeTreatment.c * -* @author (last) Darren Cox -* @date (last) 06-Oct-2023 +* @author (last) Vinayakam Mani +* @date (last) 12-Oct-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -1122,9 +1122,8 @@ DIALYSIS_STATE_T currDialysisState = getDialysisState(); UF_STATE_T currUFState = getUltrafiltrationState(); F32 remUFVol = uFVolume - colUFVol; // What would remaining UF volume be after subtracting UF volume already taken - F32 remUFVolCap = RANGE( remUFVol, 0.0F, (F32)MAX_UF_VOLUME_ML ); // Enforce valid range on remaining UF volume - F32 uFRate = remUFVolCap / txMinRem; // What UF rate would be if user selected to adjust it - U32 trtTime = ( fabs( presUFRate ) < NEARLY_ZERO ? txMinEla + 1 : (S32)( remUFVolCap / presUFRate ) + txMinEla + 1 ); // What the treatment duration would be if user selected to adjust it + F32 uFRate = remUFVol / txMinRem; // What UF rate would be if user selected to adjust it + U32 trtTime = ( fabs( presUFRate ) < NEARLY_ZERO ? txMinEla + 1 : (S32)( remUFVol / presUFRate ) + txMinEla + 1 ); // What the treatment duration would be if user selected to adjust it U32 dialVolume = getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ) * trtTime; // What dialysate volume would be if user selected to adjust time // UF should already be paused but let's make sure. @@ -1139,7 +1138,7 @@ pendingParamChangesTimer = getMSTimerCount(); // Verify UF rate change would be valid (leave zero if not valid - UI will disable option) - if ( ( uFRate <= (F32)MAX_UF_RATE_ML_MIN ) && ( uFRate >= MIN_UF_RATE_ML_MIN ) ) + if ( uFRate <= (F32)MAX_UF_RATE_ML_MIN ) { result = TRUE; pendingUFVolumeChange = uFVolume;