Index: firmware/App/Modes/ModeFlush.c =================================================================== diff -u -rd0536d759cb33f099357033c3429401ff1637d26 -r7b5a4611feae5dd5ac058afba94672881c819d7c --- firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision d0536d759cb33f099357033c3429401ff1637d26) +++ firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision 7b5a4611feae5dd5ac058afba94672881c819d7c) @@ -573,18 +573,18 @@ if ( DG_RESERVOIR_BELOW_TARGET == rsrvr1Status ) { + F32 volumeML = getLoadCellSmallFilteredWeight( LOAD_CELL_RESERVOIR_2_PRIMARY ); + rsrvr1Status = getRsrvrFillStatus( DG_RESERVOIR_1, RSRVRS_FULL_VOL_ML, RSRVRS_FILL_UP_TIMEOUT_MS ); - // Keep monitoring the status of reservoir 2 as the same time - rsrvr2Status = getRsrvrFillStatus( DG_RESERVOIR_2, RSRVRS_PARTIAL_FILL_VOL_ML, RSRVRS_PARTIAL_FILL_TIMEOUT_MS ); // Reservoir 2 cannot be filled before reservoir 1 is filled and is overflowing to reservoir 2. If reservoir 2 has already // reached to target volume, it means reservoir 1's load cell might be reading incorrect values. This situation might continue // until reservoir 2 is filled up and the tubing might expand or leak. - if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) + if ( volumeML >= RSRVRS_PARTIAL_FILL_VOL_ML ) { - prevFlushState = state; + prevFlushState = state; alarmDetectedPendingTrigger = ALARM_ID_DG_INVALID_LOAD_CELL_VALUE; - state = DG_FLUSH_STATE_CANCEL_WATER_PATH; + state = DG_FLUSH_STATE_CANCEL_WATER_PATH; } } else if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) @@ -661,21 +661,22 @@ // First reservoir 2 must be completely full but if reservoir 1 is filled before reservoir 2 is full, alarm if ( DG_RESERVOIR_BELOW_TARGET == rsrvr2Status ) { - rsrvr2Status = getRsrvrFillStatus( DG_RESERVOIR_2, RSRVRS_FULL_VOL_ML, RSRVRS_FILL_UP_TIMEOUT_MS ); - U32 drainPumpRPM = getDrainPumpTargetRPM(); // Keep monitoring the status of reservoir 1 as the same time F32 volume = getLoadCellSmallFilteredWeight( LOAD_CELL_RESERVOIR_1_PRIMARY ); + + rsrvr2Status = getRsrvrFillStatus( DG_RESERVOIR_2, RSRVRS_FULL_VOL_ML, RSRVRS_FILL_UP_TIMEOUT_MS ); + // Reservoir 1 cannot be filled before reservoir 2 is filled and is overflowing to reservoir 1. If reservoir 1 has already // reached to target volume, it means reservoir 2's load cell might be reading incorrect values. This situation might continue // until reservoir 1 is filled up and the tubing might expand or leak. // Before checking whether reservoir 1 is filled pre-maturely, we have to make sure reservoir 1 is drained completely to make // sure the extra volume that is read is not because of previous water that is being drained currently and it is above 500 mL if ( ( volume >= RSRVRS_PARTIAL_FILL_VOL_ML ) && ( 0 == drainPumpRPM ) ) { - prevFlushState = state; + prevFlushState = state; alarmDetectedPendingTrigger = ALARM_ID_DG_INVALID_LOAD_CELL_VALUE; - state = DG_FLUSH_STATE_CANCEL_WATER_PATH; + state = DG_FLUSH_STATE_CANCEL_WATER_PATH; } } // Once reservoir 2 is full, reservoir 1 must be partially full