Index: firmware/App/Drivers/BalancingChamber.c =================================================================== diff -u -r8c235d1df76e4d1ab6e6272e5bd535cfa07b513c -rdedf0cbae7f010d314c430f06834114213e18f2c --- firmware/App/Drivers/BalancingChamber.c (.../BalancingChamber.c) (revision 8c235d1df76e4d1ab6e6272e5bd535cfa07b513c) +++ firmware/App/Drivers/BalancingChamber.c (.../BalancingChamber.c) (revision dedf0cbae7f010d314c430f06834114213e18f2c) @@ -352,6 +352,16 @@ // Update fill status flag to true isBalChamberFillInProgress = TRUE; + // Deliver dosing during generate dialysate mode + if ( FALSE == getBalChamberSwitchingOnlyStatus() ) + { + // start acid and bicarb pump with the expected quantity + setConcentratePumpTargetSpeed( D11_PUMP, CONCENTRATE_PUMP_MAX_SPEED, TEST_ACID_VOLUME_ML ); + setConcentratePumpTargetSpeed( D10_PUMP, CONCENTRATE_PUMP_MAX_SPEED, TEST_BICARB_VOLUME_ML ); + requestConcentratePumpOn( D11_PUMP ); + requestConcentratePumpOn( D10_PUMP ); + } + state = BAL_CHAMBER_STATE1_BICARB_ACID_DOSING_CNTRL; } else @@ -375,26 +385,19 @@ { BAL_CHAMBER_EXEC_STATE_T state; - // Deliver dosing during generate dialysate mode - if ( FALSE == getBalChamberSwitchingOnlyStatus() ) + // On dosing completion, transition to next state based on the current switching state + if ( TRUE == IsConcentratePumpDosingCompleted() ) { - // start acid and bicarb pump with the expected quantity - setConcentratePumpTargetSpeed( D11_PUMP, CONCENTRATE_PUMP_MAX_SPEED, TEST_ACID_VOLUME_ML ); - setConcentratePumpTargetSpeed( D10_PUMP, CONCENTRATE_PUMP_MAX_SPEED, TEST_BICARB_VOLUME_ML ); - requestConcentratePumpOn( D11_PUMP ); - requestConcentratePumpOn( D10_PUMP ); + if ( BAL_CHAMBER_SW_STATE1 == balChamberSWState ) + { + state = BAL_CHAMBER_STATE1_FILL_END; + } + else + { + state = BAL_CHAMBER_STATE2_FILL_END; + } } - // On triggering of dosing, transition to next state based on the current switching state - if ( BAL_CHAMBER_SW_STATE1 == balChamberSWState ) - { - state = BAL_CHAMBER_STATE1_FILL_END; - } - else - { - state = BAL_CHAMBER_STATE2_FILL_END; - } - return state; } @@ -421,7 +424,6 @@ // ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) { // stabilized pressure indicating fill is complete - //TODO : due to pressure testing override, comment the code below for now isPressureStalbilizedDuringFill = TRUE; // isPressureStalbilizedDuringFill = FALSE; } @@ -432,10 +434,6 @@ { // close the state 1 opened valves valveControlForBCState1FillEnd(); - - //Stop the concentrate pumps - requestConcentratePumpOff( D11_PUMP, NO_PARK_CONC_PUMPS ); - requestConcentratePumpOff( D10_PUMP, NO_PARK_CONC_PUMPS ); } // On completion of cycle time, transition to next state @@ -493,6 +491,16 @@ // Update fill status flag to true isBalChamberFillInProgress = TRUE; + // Deliver dosing during generate dialysate mode + if ( FALSE == getBalChamberSwitchingOnlyStatus() ) + { + // start acid and bicarb pump with the expected quantity + setConcentratePumpTargetSpeed( D11_PUMP, CONCENTRATE_PUMP_MAX_SPEED, TEST_ACID_VOLUME_ML ); + setConcentratePumpTargetSpeed( D10_PUMP, CONCENTRATE_PUMP_MAX_SPEED, TEST_BICARB_VOLUME_ML ); + requestConcentratePumpOn( D11_PUMP ); + requestConcentratePumpOn( D10_PUMP ); + } + state = BAL_CHAMBER_STATE2_BICARB_ACID_DOSING_CNTRL; } else @@ -526,7 +534,6 @@ // ( ( spentDialPressure >= SPENT_DIAL_PRESSURE_MIN_PSIG ) && ( spentDialPressure <= SPENT_DIAL_PRESSURE_MAX_PSIG ) ) ) { // stabilized pressure indicating fill is complete - //TODO : due to pressure testing override, comment the code below for now isPressureStalbilizedDuringFill = TRUE; //isPressureStalbilizedDuringFill = FALSE; } @@ -537,10 +544,6 @@ { // close the valves valveControlForBCState2FillEnd(); - - //Stop the concentrate pumps - requestConcentratePumpOff( D11_PUMP, NO_PARK_CONC_PUMPS ); - requestConcentratePumpOff( D10_PUMP, NO_PARK_CONC_PUMPS ); } // On completion of cycle time, transition to next state