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; Index: firmware/App/Modes/ModeChemicalDisinfectFlush.c =================================================================== diff -u -rdaf4763d6f40baf4cbc2f9d88aba7d9faf588ad6 -r352a720124edcbbc0c58856c2d23ddf32e558c02 --- firmware/App/Modes/ModeChemicalDisinfectFlush.c (.../ModeChemicalDisinfectFlush.c) (revision daf4763d6f40baf4cbc2f9d88aba7d9faf588ad6) +++ firmware/App/Modes/ModeChemicalDisinfectFlush.c (.../ModeChemicalDisinfectFlush.c) (revision 352a720124edcbbc0c58856c2d23ddf32e558c02) @@ -124,8 +124,7 @@ static U32 drainTimer = 0; ///< Timer for reservoir draining during flush states static U32 dataPublishCounter = 0; ///< Chemical disinfect flush data publish counter. static CANCELLATION_MODE_T cancellationMode = CANCELLATION_MODE_NONE; ///< Cancellation mode. -static U32 rsrvrFillStableTimeCounter; ///< Reservoirs fill stable time counter. -static U32 rsrvrFillToFullStableTimeCounter = 0; ///< Task interval counter for determining if reservoir is full +static U32 rsrvrFillToFullStableTimerCounter = 0; ///< Task interval counter for determining if reservoir is full static ALARM_ID_T alarmDetectedPendingTrigger; ///< Chemical disinfect flush alarm to raise. static U32 numberOfPostDisinfectRinses; ///< Number of times to rinse the fluid path after chemical disinfect flush. static DISINFECT_FLUSH_NV_OPS_T disinfectFlushNVOps; ///< Disinfect flush non-volatile memory operations. @@ -160,7 +159,7 @@ * @details Outputs: chemDisinfectFlushState, stateTimer, isThisLastDrain, * stateTrialCounter, rsrvr1Status, rsrvr2Status, haveInletWaterChecksPassed, * overallChemDisinfectFlushTimer, - * cancellationMode, rsrvrFillStableTimeCounter, prevChemDisinfectFlushState + * cancellationMode, rsrvrFillToFullStableTimeCounter, prevChemDisinfectFlushState * numberOfPostDisinfectRinses, * chemDisinfectFlushUIState, * disinfectFlushNVOps @@ -178,7 +177,7 @@ rsrvr2Status = NUM_OF_DG_RESERVOIR_STATUS; overallChemDisinfectFlushTimer = 0; cancellationMode = CANCELLATION_MODE_NONE; - rsrvrFillStableTimeCounter = 0; + rsrvrFillToFullStableTimerCounter = 0; numberOfPostDisinfectRinses = 0; chemDisinfectFlushUIState = CHEM_DISINFECT_FLUSH_UI_STATE_NOT_RUNNING; disinfectFlushNVOps.hasDisFlushCompleteDateBeenWrittenToNV = FALSE; @@ -339,7 +338,6 @@ setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); setValveState( VRD1, VALVE_STATE_OPEN ); setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); - rsrvrFillStableTimeCounter = 0; rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; stateTimer = getMSTimerCount(); @@ -543,6 +541,7 @@ rsrvr2Status = DG_RESERVOIR_BELOW_TARGET; drainTimer = getMSTimerCount(); numberOfPostDisinfectRinses = 0; + rsrvrFillToFullStableTimerCounter = 0; stateTimer = getMSTimerCount(); state = DG_CHEM_DISINFECT_FLUSH_STATE_FLUSH_R2_TO_R1_DRAIN_R1; } @@ -924,24 +923,24 @@ // Check the volume of the reservoir against the previous volume if ( ( currentVolume > RESERVOIR_MINIMUM_FULL_VOLUME_ML ) && ( fabs( currentVolume - filteredVolume ) < RESERVOIR_FULL_VOLUME_CHANGE_LIMIT_ML ) ) { - if ( ++rsrvrFillToFullStableTimeCounter >= RSRVRS_FILL_TO_FULL_STABLE_TASK_INT ) + if ( ++rsrvrFillToFullStableTimerCounter >= RSRVRS_FILL_TO_FULL_STABLE_TASK_INT ) { status = DG_RESERVOIR_REACHED_TARGET; - rsrvrFillToFullStableTimeCounter = 0; + rsrvrFillToFullStableTimerCounter = 0; // Set the state timer in case it needs to be used for another timeout check stateTimer = getMSTimerCount(); } } else if ( TRUE == didTimeout( stateTimer, timeout ) ) { - // Failed to fill ontime. Update the previous chemical disinfect state and transition to basic cancellation + // Failed to fill on time. Update the previous chemical disinfect state and transition to basic cancellation prevChemDisinfectFlushState = chemDisinfectFlushState; alarmDetectedPendingTrigger = ALARM_ID_DG_RESERVOIR_FILL_TIMEOUT; status = DG_RESERVOIR_NOT_REACHED_TARGET; } else { - rsrvrFillToFullStableTimeCounter = 0; + rsrvrFillToFullStableTimerCounter = 0; } return status; }