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; }