Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -re970cb1e6259770040219849902bc5747f39e728 -ra631e128cd6be44aa232e23b58a229bfb8fe9043 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision e970cb1e6259770040219849902bc5747f39e728) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision a631e128cd6be44aa232e23b58a229bfb8fe9043) @@ -7,8 +7,8 @@ * * @file BalancingChamber.c * -* @author (last) Jashwant Gantyada -* @date (last) 21-May-2026 +* @author (last) Sameer Kalliadan Poyil +* @date (last) 24-Jun-2026 * * @author (original) Vinayakam Mani * @date (original) 28-Jan-2025 @@ -23,6 +23,7 @@ #include "FpgaDD.h" #include "Heaters.h" #include "Level.h" +#include "MixingControl.h" #include "ModeGenDialysate.h" #include "ModeStandby.h" #include "Messaging.h" @@ -240,6 +241,34 @@ /*********************************************************************//** * @brief + * The getBicarbDoseVol function gets the bicarb dose volume + * @details \b Inputs: bicarbDoseVolume + * @details \b Outputs: none + * @return TRUE if successful, FALSE if not. + *************************************************************************/ +F32 getBicarbDoseVol( void ) +{ + F32 result = getF32OverrideValue( &bicarbDoseVolume ); + + return result; +} + +/*********************************************************************//** + * @brief + * The getAcidDoseVol function gets acid mix volume + * @details \b Inputs: acidDoseVolume + * @details \b Outputs: none + * @return TRUE if successful, FALSE if not. + *************************************************************************/ +F32 getAcidDoseVol( void ) +{ + F32 result = getF32OverrideValue( &acidDoseVolume ); + + return result; +} + +/*********************************************************************//** + * @brief * The applyBalChamberSwitchingPeriod function applies the active balancing * chamber switching time based on the provided dialysis flow rate. * @details \b Inputs: Dialysis flow rate. @@ -341,7 +370,7 @@ currentBalChamberSwitchingCounter += 1; currentBalChamberFillCounter += 1; - if ( ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICARB ) == TRUE ) && ( balChamberExecState > BAL_CHAMBER_STATE_IDLE ) ) + if ( ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) && ( balChamberExecState > BAL_CHAMBER_STATE_IDLE ) ) { #ifdef CONDUCTIVE_LEVEL_SENSOR_ENABLED if ( LVL_STATE_LOW == bicarbChamberLevel ) @@ -617,7 +646,7 @@ spentFillRiseMissCounter = 0; isSpentFillComplete = FALSE; - if ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICARB ) == TRUE ) + if ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) { bicarbVolume = getBicarbMixVol(); acidVolume = getAcidMixVol(); @@ -763,7 +792,7 @@ } // If the dry bicarbonate is enabled then we ignore looking at d18 pressure to be in range. - if ( ( TRUE == getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICARB ) ) && ( TRUE == getBicarbChamberFillRequested() ) ) + if ( ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) && ( TRUE == getBicarbChamberFillRequested() ) ) { isPressureStabilizedDuringFill = TRUE; } @@ -935,7 +964,7 @@ spentFillRiseMissCounter = 0; isSpentFillComplete = FALSE; - if ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICARB ) == TRUE ) + if ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) { bicarbVolume = getBicarbMixVol(); acidVolume = getAcidMixVol(); @@ -1015,7 +1044,7 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // If the dry bicarbonate is enabled then we ignore looking at d18 pressure to be in range. - if ( ( TRUE == getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICARB ) ) && ( TRUE == getBicarbChamberFillRequested() ) ) + if ( ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) && ( TRUE == getBicarbChamberFillRequested() ) ) { isPressureStabilizedDuringFill = TRUE; }