Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r1077fee46974061e6e0038b6c0ce0e1471715b61 -rad5fb11958cfc9829b879f440cd139c7c2e26fe3 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 1077fee46974061e6e0038b6c0ce0e1471715b61) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision ad5fb11958cfc9829b879f440cd139c7c2e26fe3) @@ -132,7 +132,7 @@ balChamberValveClosePeriod = 0; isBalChamberFillInProgress = FALSE; currentBalChamberSwitchingCounter = 0; - isPressureStalbilizedDuringFill = FALSE; + isPressureStabilizedDuringFill = FALSE; lastTdDialysateFlowrate = 0.0F; balChamberDataPublicationTimerCounter = 0; balChamberFillPressureDropCounter = 0; @@ -434,7 +434,7 @@ currentBalChamberFillCounter = 0; balChamberFillTimeoutCount = 0; isBalChamberFillInProgress = FALSE; - isPressureStalbilizedDuringFill = FALSE; + isPressureStabilizedDuringFill = FALSE; isPressureDroppedDuringFill = FALSE; isSpentFillComplete = FALSE; @@ -554,16 +554,12 @@ // Check fresh dialysate pressure back in range to indicate fresh fill complete. if ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) { - if ( TRUE == isFreshDialysatePressureInRange && TRUE == isSpentDialysatePressureInRange ) + if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) { // stabilized pressure indicating fresh side fill is complete isPressureStabilizedDuringFill = TRUE; } } - else - { - isPressureStalbilizedDuringFill = FALSE; - } // Spent side of balancing chamber fill is complete or not checkSpentFillComplete( spentDialPressure ); @@ -659,7 +655,7 @@ BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE2_FILL_START; currentBalChamberSwitchingCounter = 0; isBalChamberFillInProgress = FALSE; - isPressureStalbilizedDuringFill = FALSE; + isPressureStabilizedDuringFill = FALSE; isPressureDroppedDuringFill = FALSE; balChamberSWState = BAL_CHAMBER_SW_STATE2; currentBalChamberFillCounter = 0; @@ -725,16 +721,12 @@ // Check fresh dialysate pressure back in range to indicate fill complete. if ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) { - if ( ( TRUE == isFreshDialysatePressureInRange ) && ( TRUE == isSpentDialysatePressureInRange ) ) + if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) { // stabilized pressure indicating fresh side fill is complete isPressureStabilizedDuringFill = TRUE; } } - else - { - isPressureStalbilizedDuringFill = FALSE; - } // If fill is taking too long, set an alarm for fill timeout if ( ( balChamberFillTimeoutCount > 0 ) && ( currentBalChamberFillCounter > balChamberFillTimeoutCount ) ) @@ -797,7 +789,7 @@ // When fill initiated, pressure is not dropped to the expected range, possible valve failures. SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_PRESSURE_DROP_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); } - else if ( TRUE != isPressureStalbilizedDuringFill ) + else if ( TRUE != isPressureStabilizedDuringFill ) { // Alarm when switching time expired, but still pressure not in range which indicates fill is not completed. SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); Index: firmware/App/Controllers/BalancingChamber.h =================================================================== diff -u -r1077fee46974061e6e0038b6c0ce0e1471715b61 -rad5fb11958cfc9829b879f440cd139c7c2e26fe3 --- firmware/App/Controllers/BalancingChamber.h (.../BalancingChamber.h) (revision 1077fee46974061e6e0038b6c0ce0e1471715b61) +++ firmware/App/Controllers/BalancingChamber.h (.../BalancingChamber.h) (revision ad5fb11958cfc9829b879f440cd139c7c2e26fe3) @@ -48,7 +48,7 @@ U32 balChamberSwPeriod; ///< Balancing chamber switching period BOOL isBalChamberFillInProgress; ///< Whether balancing chamber fill in progress or not U32 currentBalChamberSwitchingCounter; ///< Current balancing chamber switching counter - BOOL isPressureStalbilizedDuringFill; ///< Whether pressure stabilized during fill or not + BOOL isPressureStabilizedDuringFill; ///< Whether pressure stabilized during fill or not BOOL balChamberSWOnlyState; ///< Balancing chamber switching only status ( On/Off) } BAL_CHAMBER_DATA_T;