Index: firmware/App/Modes/ModeGenDialysate.c =================================================================== diff -u -r623587d96bf6c0bafd3ff94d47f8c783b4b999f0 -r6d0bd19fb192dcd272fa773e8833862cc8a8f750 --- firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 623587d96bf6c0bafd3ff94d47f8c783b4b999f0) +++ firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 6d0bd19fb192dcd272fa773e8833862cc8a8f750) @@ -7,8 +7,8 @@ * * @file ModeGenDialysate.c * -* @author (last) Vinayakam Mani -* @date (last) 06-Apr-2026 +* @author (last) Arpita Srivastava +* @date (last) 10-Apr-2026 * * @author (original) Vinayakam Mani * @date (original) 06-Nov-2024 @@ -175,6 +175,8 @@ initGenDialysateMode(); setCurrentSubState( NO_SUB_STATE ); + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); //calculateD48PumpSpeedForBCFill(); initialD48PumpSpeed = getCalculatedD48PumpSpeedForBCFill(); setD48PumpSpeedForBCFill( initialD48PumpSpeed ); @@ -243,7 +245,8 @@ switch( state ) { case DD_GEND_STATE_START: - // Do nothing + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); break; case DD_GEND_DIALYSATE_BYPASS_STATE: @@ -292,13 +295,18 @@ setRinsePumpState( RINSE_PUMP_STATE_ON ); transitionToBalChamberFill(); + // Activate Balancing Chamber Switching + requestBalChamberSwitching( TRUE ); //Testing bypassStateDelayStartTimeMS = getMSTimerCount(); delayBypassStateFlag = TRUE; break; case DD_GEND_DIALYSATE_DELIVERY_STATE: + // Activate Balancing Chamber Switching + requestBalChamberSwitching( TRUE ); + //Previous state setValveState( D47_VALV, VALVE_STATE_CLOSED ); // spent chamber purge valve setValveState( D8_VALV, VALVE_STATE_CLOSED ); @@ -347,6 +355,9 @@ break; case DD_GEND_SPENT_CHAMBER_FILL_STATE: + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); + //Set valves and actuators setValveState( D35_VALV, VALVE_STATE_CLOSED ); // VDI setValveState( D40_VALV, VALVE_STATE_CLOSED ); // VDO @@ -390,6 +401,9 @@ break; case DD_GEND_BICARB_CHAMBER_FILL_STATE: + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); + requestConcentratePumpOff( D11_PUMP, FALSE ); requestConcentratePumpOff( D10_PUMP, FALSE ); requestConcentratePumpOff( D76_PUMP, FALSE ); @@ -426,6 +440,8 @@ break; case DD_GEND_DIALYSATE_DELIVERY_PAUSE: + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); setDialysatePumpTargetRPM( D12_PUMP, getFreshDialPumpInitialRpm(), TRUE ); signalDialysatePumpHardStop( D48_PUMP ); requestConcentratePumpOff( D11_PUMP, FALSE ); @@ -467,6 +483,8 @@ break; case DD_GEND_ISOLATED_UF_STATE: + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); //TODO : define actuators states break; @@ -755,11 +773,6 @@ delayBypassStateFlag = FALSE; } } - else - { - //Execute balancing chamber - execBalancingChamberControl(); - } if ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_SPENT_CHAMBER_H_FILL ) == TRUE ) { @@ -836,9 +849,6 @@ #endif else { - //Execute balancing chamber - execBalancingChamberControl(); - //Execute ultrafiltration execUFControl(); }