Index: firmware/App/Modes/ModeChemicalDisinfect.c =================================================================== diff -u -rdaf4763d6f40baf4cbc2f9d88aba7d9faf588ad6 -r352a720124edcbbc0c58856c2d23ddf32e558c02 --- firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision daf4763d6f40baf4cbc2f9d88aba7d9faf588ad6) +++ firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision 352a720124edcbbc0c58856c2d23ddf32e558c02) @@ -168,8 +168,6 @@ static U32 inletWaterChecksFailCounter = 0; ///< Timer/counter for inlet water check failures. static DG_RESERVOIR_STATUS_T rsrvr1Status = NUM_OF_DG_RESERVOIR_STATUS; ///< Reservoir 1 status. static DG_RESERVOIR_STATUS_T rsrvr2Status = NUM_OF_DG_RESERVOIR_STATUS; ///< Reservoir 2 status. -static F32 R1ChemDisinfectVol = 0.0; ///< Reservoir 1 full volume during chemical disinfect. TODO: decide if these volumes are needed -static F32 R2ChemDisinfectVol = 0.0; ///< Reservoir 2 full volume during chemical disinfect. TODO: decide if these volumes are needed static BOOL isRsrvrLeaking = FALSE; ///< Flag used to determine if reservoir is leaking. static U32 rsrvrsVolMonitorCounter = 0; ///< Timer/counter used to determine if reservoir is leaking. static U32 chemDisinfectReservoirTime = 0; ///< Chemical disinfect accumulated time in ms above the temperature target in one cycle for reservoir 1 or reservoir 2. @@ -179,12 +177,12 @@ static U32 drpControlTimerCounter = 0; ///< Timer/counter for reservoir volume control of DRP. static U32 dataPublishCounter = 0; ///< Chemical Disinfect data publish timer/counter. static CANCELLATION_MODE_T cancellationMode = CANCELLATION_MODE_NONE; ///< Cancellation mode. -static U32 rsrvrFillStableTimeCounter; ///< Reservoirs fill stable time counter. static ALARM_ID_T alarmDetectedPendingTrigger; ///< Chemical disinfect alarm to raise. static U32 flushCircWaitTime; ///< Variable time period in ms to wait in flush circulation state to check sensor values. static U32 flushDisinfectantWaitTime; ///< Variable time period in ms to wait in disinfectant flush state to check sensor values. static U32 primeAcidSteadyStateCounter = 0; ///< Prime acid steady state counter. static U32 minMaxConductivityWaitCounter = 0; ///< Timer/counter for the disinfect conductivity check. +static U32 rsrvrFillStableTimeCounter = 0; ///< Task interval timer/counter for determining if reservoir has reached fill target. static U32 rsrvrFillToFullStableTimeCounter = 0; ///< Task interval timer/counter for determining if reservoir is full. static F32 R1FullVolume = 0.0; ///< R1 volume determined by fill to full function. static F32 R2FullVolume = 0.0; ///< R2 volume determined by fill to full function. @@ -243,11 +241,9 @@ stateTrialCounter = 0; rsrvr1Status = NUM_OF_DG_RESERVOIR_STATUS; rsrvr2Status = NUM_OF_DG_RESERVOIR_STATUS; - R1ChemDisinfectVol = 0.0; - R2ChemDisinfectVol = 0.0; overallChemDisinfectTimer = 0; cancellationMode = CANCELLATION_MODE_NONE; - rsrvrFillStableTimeCounter = 0; + rsrvrFillToFullStableTimeCounter = 0; primeAcidSteadyStateCounter = 0; disinfectantMixRatio = 0.0; isRsrvrLeaking = FALSE; @@ -801,6 +797,7 @@ rsrvr1Status = DG_RESERVOIR_BELOW_TARGET; rsrvr2Status = DG_RESERVOIR_BELOW_TARGET; chemDisinfectReservoirTime = 0; + rsrvrFillStableTimeCounter = 0; isChemDisinfectTemperatureAboveTarget = FALSE; stateTimer = getMSTimerCount(); state = DG_CHEM_DISINFECT_STATE_FILL_WITH_DISINFECTANT; @@ -855,7 +852,6 @@ // Set the drain pump to control mode controlDRPByReservoirVolume( DG_RESERVOIR_2, TRUE ); //Initialize the PI controller for DRP - R1ChemDisinfectVol = getLoadCellLargeFilteredWeight( LOAD_CELL_RESERVOIR_1_PRIMARY ); isRsrvrLeaking = FALSE; ischemDisinfectWarmupTargetReached = FALSE; stateTimer = getMSTimerCount(); @@ -960,7 +956,6 @@ } if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) { - R2ChemDisinfectVol = getLoadCellLargeFilteredWeight( LOAD_CELL_RESERVOIR_2_PRIMARY ); isRsrvrLeaking = FALSE; chemDisinfectReservoirTime = 0; isChemDisinfectTemperatureAboveTarget = FALSE; @@ -1099,7 +1094,6 @@ chemDisinfectReservoirTime = 0; isChemDisinfectTemperatureAboveTarget = FALSE; ischemDisinfectWarmupTargetReached = FALSE; - R1ChemDisinfectVol = getLoadCellLargeFilteredWeight( LOAD_CELL_RESERVOIR_1_PRIMARY ); isRsrvrLeaking = FALSE; stateTimer = getMSTimerCount(); state = DG_CHEM_DISINFECT_STATE_DISINFECT_R1_TO_R2;