Index: firmware/App/Modes/ModeGenDialysate.c =================================================================== diff -u -r4237cbced773b985ff69a8c2af8287dbd5457f24 -r173453569b2eb31b3f19572bf5386440667b0162 --- firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 4237cbced773b985ff69a8c2af8287dbd5457f24) +++ firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 173453569b2eb31b3f19572bf5386440667b0162) @@ -350,9 +350,6 @@ 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 @@ -763,10 +760,16 @@ { if ( ( TRUE == pendingSpentChamberFill ) && ( FALSE == balancingChambFillInProgress ) ) { - setModeGenDStateTransition( DD_GEND_SPENT_CHAMBER_FILL_STATE ); - pendingSpentChamberFill = FALSE; - isDialDeliveryInProgress.data = FALSE; - state = DD_GEND_SPENT_CHAMBER_FILL_STATE; + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); + + if ( getBalancingChamberStatus()== FALSE ) + { + setModeGenDStateTransition( DD_GEND_SPENT_CHAMBER_FILL_STATE ); + pendingSpentChamberFill = FALSE; + isDialDeliveryInProgress.data = FALSE; + state = DD_GEND_SPENT_CHAMBER_FILL_STATE; + } } } #ifdef __BICARB_CHAMBER_FILL__ @@ -817,10 +820,16 @@ { if ( ( TRUE == pendingSpentChamberFill ) && ( FALSE == balancingChambFillInProgress ) ) { - setModeGenDStateTransition( DD_GEND_SPENT_CHAMBER_FILL_STATE ); - pendingSpentChamberFill = FALSE; - isDialDeliveryInProgress.data = FALSE; - state = DD_GEND_SPENT_CHAMBER_FILL_STATE; + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); + + if ( getBalancingChamberStatus()== FALSE ) + { + setModeGenDStateTransition( DD_GEND_SPENT_CHAMBER_FILL_STATE ); + pendingSpentChamberFill = FALSE; + isDialDeliveryInProgress.data = FALSE; + state = DD_GEND_SPENT_CHAMBER_FILL_STATE; + } } } #ifdef __BICARB_CHAMBER_FILL__ @@ -862,6 +871,7 @@ { setModeGenDStateTransition( DD_GEND_DIALYSATE_BYPASS_STATE ); isDialDeliveryInProgress.data = FALSE; + //delayBypassStateFlag = TRUE; state = DD_GEND_DIALYSATE_BYPASS_STATE; //Trigger alarm if count exceeded