Index: firmware/App/Modes/ModeChemicalDisinfect.c =================================================================== diff -u -r995ac6377531c6b1a7459891d8c6c3762b800cab -r0970cd6acc62242201769feada1cf7f5cc01508a --- firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision 995ac6377531c6b1a7459891d8c6c3762b800cab) +++ firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision 0970cd6acc62242201769feada1cf7f5cc01508a) @@ -1382,7 +1382,7 @@ static DG_RESERVOIR_STATUS_T getRsrvrDrainStatus( DG_RESERVOIR_ID_T r, U32 drainSteadyStateTimeout, U32 timeout ) { DG_RESERVOIR_STATUS_T status = DG_RESERVOIR_ABOVE_TARGET; - BOOL isDrainComplete = hasTargetDrainToZeroBeenReached( r, drainSteadyStateTimeout ); + BOOL isDrainComplete = FALSE; // If the drain parameters of the reservoir is not initialized, initialize them if ( FALSE == haveDrainParamsBeenInit[ r ] ) @@ -1391,6 +1391,10 @@ haveDrainParamsBeenInit[ r ] = TRUE; } + // NOTE: the drain status should be checked once the reservoirs parameters are initialized. This is to make sure the + // the timers for stable drain time are initialized prior to using them again + isDrainComplete = hasTargetDrainToZeroBeenReached( r, drainSteadyStateTimeout ); + if ( TRUE == isDrainComplete ) { stateTimer = getMSTimerCount();