Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -rb4e65bc0026ff22f0bb77e4e066724368ef1cfd5 -r788a0b1a638d815df1e83af80cba7be03af2020c --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision b4e65bc0026ff22f0bb77e4e066724368ef1cfd5) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 788a0b1a638d815df1e83af80cba7be03af2020c) @@ -7,8 +7,8 @@ * * @file BalancingChamber.c * -* @author (last) Vinayakam Mani -* @date (last) 01-Jun-2026 +* @author (last) Sameer Kalliadan Poyil +* @date (last) 24-Jun-2026 * * @author (original) Vinayakam Mani * @date (original) 28-Jan-2025 @@ -24,9 +24,10 @@ #include "Heaters.h" #include "Level.h" #include "MessageSupport.h" +#include "Messaging.h" +#include "MixingControl.h" #include "ModeGenDialysate.h" #include "ModeStandby.h" -#include "Messaging.h" #include "OperationModes.h" #include "Pressure.h" #include "TaskGeneral.h" @@ -244,6 +245,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. @@ -332,8 +361,8 @@ /*********************************************************************//** * @brief * The execBalancingChamberControl function executes the balancing chamber state machine. - * @details \b Inputs: balChamberExecState - * @details \b Outputs: balChamberExecState + * @details \b Inputs: balChamberExecState, prevBalChamberState + * @details \b Outputs: balChamberExecState prevBalChamberState * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when wrong balancing chamber state invoked. * @return current state. *************************************************************************/ @@ -345,7 +374,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 ) @@ -632,7 +661,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(); @@ -778,7 +807,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; } @@ -950,7 +979,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(); @@ -1030,7 +1059,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; } @@ -1480,15 +1509,15 @@ * @brief * The setBalChamberSwitchingOnlyStatus function sets the balancing chamber * switching only On/Off status. - * @details \b Inputs: balanceChamberSwitchingOnly + * @details \b Inputs: balanceChamberSwitchingOnly, isBalChamberSwitchingActive * @details \b Outputs: none * @param OnOff to set the BC switch status * @return none *************************************************************************/ void setBalChamberSwitchingOnlyStatus( BOOL OnOff ) { balanceChamberSwitchingOnly = OnOff; - SEND_EVENT_WITH_2_U32_DATA( DD_EVENT_BC_SWITCH_ONLY_MODE_CHANGE, balanceChamberSwitchingOnly,isBalChamberSwitchingActive ); + SEND_EVENT_WITH_2_U32_DATA( DD_EVENT_BC_SWITCH_ONLY_MODE_CHANGE, balanceChamberSwitchingOnly, isBalChamberSwitchingActive ); } /*********************************************************************//**