Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -rd056502f61fbd230415ead33a52f6eeb0ace9b6b -r9a750b1563a654a0eb3efe50ebae6a4ed7fa3734 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision d056502f61fbd230415ead33a52f6eeb0ace9b6b) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 9a750b1563a654a0eb3efe50ebae6a4ed7fa3734) @@ -187,6 +187,9 @@ //Update last td dialysate flow rate lastTdDialysateFlowrate = tdDialysateFlowrate; + // Update fill timeout count based on the switching period (e.g. 150% of period) + balChamberFillTimeoutCount = (U32)( (F32)balChamberSwitchingPeriod * BAL_CHAMBER_FILL_TIMEOUT_FACTOR ); + //Reset the BC switching flag for new Qd. isFirstCycleBCSwitchingCompleted = FALSE; @@ -568,12 +571,6 @@ if ( TRUE == isFillCompleteOrFirstCycle ) { - // On successful completion, learn timeout as 150% of the observed fill count (once per cycle). - if ( balChamberFillTimeoutCount == 0U ) - { - balChamberFillTimeoutCount = currentBalChamberFillCounter * BAL_CHAMBER_FILL_TIMEOUT_FACTOR; - } - // close the state 1 opened valves valveControlForBCState1FillEnd(); isBalChamberFillInProgress = FALSE; @@ -747,12 +744,6 @@ if ( TRUE == isFillCompleteOrFirstCycle ) { - // On successful completion, learn timeout as 150% of the observed fill count (once per cycle). - if ( balChamberFillTimeoutCount == 0U ) - { - balChamberFillTimeoutCount = currentBalChamberFillCounter * BAL_CHAMBER_FILL_TIMEOUT_FACTOR; - } - // close the valves valveControlForBCState2FillEnd(); isBalChamberFillInProgress = FALSE;