Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -re308299611ea735e2521092967a3198f579d1158 -rd28018ec9af4486c787c4205257ad2cf68da8cfd --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision e308299611ea735e2521092967a3198f579d1158) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision d28018ec9af4486c787c4205257ad2cf68da8cfd) @@ -150,31 +150,31 @@ // ********** private data ********** -static DG_HEAT_DISINFECT_STATE_T heatDisinfectState = DG_HEAT_DISINFECT_STATE_START; ///< Current active heat disinfect state. -static DG_HEAT_DISINFECT_STATE_T prevHeatDisinfectState = DG_HEAT_DISINFECT_STATE_START; ///< Previous active heat disinfect state before alarm. -static DG_HEAT_DISINFECT_UI_STATE_T heatDisinfectUIState = HEAT_DISINFECT_UI_STATE_NOT_RUNNING; ///< Current active heat disinfect UI state. -static U32 overallHeatDisinfectTimer = 0; ///< Heat disinfect cycle total timer. -static U32 stateTimer = 0; ///< Heat disinfect state timer to be used in different states. -static U32 stateTrialCounter = 0; ///< Heat disinfect state trial counter to be used for retries in different states. -static BOOL areTempSensorsInRange = FALSE; ///< Heat disinfect temperature sensors in/out range flag. -static U32 concentratePumpsPrimeTimer = 0; ///< Concentrate pumps prime timer. +static DG_HEAT_DISINFECT_STATE_T heatDisinfectState; ///< Current active heat disinfect state. +static DG_HEAT_DISINFECT_STATE_T prevHeatDisinfectState; ///< Previous active heat disinfect state before alarm. +static DG_HEAT_DISINFECT_UI_STATE_T heatDisinfectUIState; ///< Current active heat disinfect UI state. +static U32 overallHeatDisinfectTimer; ///< Heat disinfect cycle total timer. +static U32 stateTimer; ///< Heat disinfect state timer to be used in different states. +static U32 stateTrialCounter; ///< Heat disinfect state trial counter to be used for retries in different states. +static BOOL areTempSensorsInRange; ///< Heat disinfect temperature sensors in/out range flag. +static U32 concentratePumpsPrimeTimer; ///< Concentrate pumps prime timer. /// Boolean flag to check whether draining R1 and R2 is at the end of the heat disinfect cycle or in the beginning. So the drain states can be reused. static BOOL isThisLastDrain = FALSE; -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 R1HeatDisinfectVol = 0.0; ///< Reservoir 1 full volume during heat disinfect. -static F32 R2HeatDisinfectVol = 0.0; ///< Reservoir 2 full volume during heat disinfect. -static U32 heatDisinfectTimer = 0; ///< Heat disinfect timer. -static BOOL isPartialDisinfectInProgress = FALSE; ///< Heat disinfect partial complete/in progess flag. -static U32 rsrvrsVolMonitorTimer = 0; ///< Reservoir 1 & 2 volume monitor timers during heat disinfect. -static BOOL areRsrvrsLeaking = FALSE; ///< Reservoir 1 & 2 leak check flag during heat disinfect. -static U32 dataPublishCounter = 0; ///< Heat Disinfect data publish counter. -static CANCELLATION_MODE_T cancellationMode = CANCELLATION_MODE_NONE; ///< Cancellation mode. +static DG_RESERVOIR_STATUS_T rsrvr1Status; ///< Reservoir 1 status. +static DG_RESERVOIR_STATUS_T rsrvr2Status; ///< Reservoir 2 status. +static F32 R1HeatDisinfectVol; ///< Reservoir 1 full volume during heat disinfect. +static F32 R2HeatDisinfectVol; ///< Reservoir 2 full volume during heat disinfect. +static U32 heatDisinfectTimer; ///< Heat disinfect timer. +static BOOL isPartialDisinfectInProgress; ///< Heat disinfect partial complete/in progess flag. +static U32 rsrvrsVolMonitorTimer; ///< Reservoir 1 & 2 volume monitor timers during heat disinfect. +static BOOL areRsrvrsLeaking; ///< Reservoir 1 & 2 leak check flag during heat disinfect. +static U32 dataPublishCounter; ///< Heat Disinfect data publish counter. +static CANCELLATION_MODE_T cancellationMode; ///< Cancellation mode. static U32 rsrvrFillStableTimeCounter; ///< Reservoirs fill stable time counter. static ALARM_ID_T alarmDetectedPendingTrigger; ///< Heat disinfect alarm to raise. -static BOOL isDrainPumpInMixDrainOn = FALSE; ///< Flag to indicate the drain pump is on during mix drain. -static U32 ROFCoolingTimer = 0; ///< RO filter cooling timer. -static U32 targetDisinfectTime = 0; ///< Target disinfect time. +static BOOL isDrainPumpInMixDrainOn; ///< Flag to indicate the drain pump is on during mix drain. +static U32 ROFCoolingTimer; ///< RO filter cooling timer. +static U32 targetDisinfectTime; ///< Target disinfect time. static BOOL haveDrainParamsBeenInit[ NUM_OF_DG_RESERVOIRS ]; ///< Boolean flag to indicate whether the drain parameters have been reset or not. static U32 tempGradOutOfRangeTimer; ///< Temperature gradient out of range start timer. static DISINFECT_NV_OPS_T disinfectNVOps; ///< Disinfect non-volatile memory operations. @@ -222,10 +222,11 @@ * stateTrialCounter, areTempSensorsInRange, rsrvr1Status, rsrvr2Status, * R1HeatDisinfectVol, R2HeatDisinfectVol, overallHeatDisinfectTimer, * cancellationMode, rsrvrFillStableTimeCounter, prevHeatDisinfectState - * isPartialDisinfectInProgress, isDrainPumpOnInMixDrain, + * isPartialDisinfectInProgress, isDrainPumpOnInMixDrain, heatDisinfectTimer * hasROFCirculationBeenStarted, ROFCirculationTimer, targetDisinfectTime - * ROFCirculationCoolingCounter, concentratePumpsPrimeTimer, - * haveDrainParamsBeenInit, tempGradOutOfRangeTimer, disinfectNVOps + * ROFCirculationCoolingCounter, concentratePumpsPrimeTimer, areRsrvrsLeaking + * haveDrainParamsBeenInit, tempGradOutOfRangeTimer, disinfectNVOps, + * dataPublishCounter * @return none *************************************************************************/ void initHeatDisinfectMode( void ) @@ -239,8 +240,8 @@ areTempSensorsInRange = FALSE; rsrvr1Status = NUM_OF_DG_RESERVOIR_STATUS; rsrvr2Status = NUM_OF_DG_RESERVOIR_STATUS; - R1HeatDisinfectVol = 0.0; - R2HeatDisinfectVol = 0.0; + R1HeatDisinfectVol = 0.0F; + R2HeatDisinfectVol = 0.0F; overallHeatDisinfectTimer = 0; cancellationMode = CANCELLATION_MODE_NONE; rsrvrFillStableTimeCounter = 0; @@ -254,6 +255,10 @@ tempGradOutOfRangeTimer = 0; disinfectNVOps.hasDisCompleteDateBeenWrittenToNV = FALSE; disinfectNVOps.hasDisStatusBeenWrittenToNV = FALSE; + heatDisinfectTimer = 0; + rsrvrsVolMonitorTimer = 0; + areRsrvrsLeaking = FALSE; + dataPublishCounter = 0; } /*********************************************************************//** @@ -1198,10 +1203,11 @@ // Get the current volumes to be monitored during R2 to R1 heat disinfect state R1HeatDisinfectVol = getLoadCellLargeFilteredWeight( LOAD_CELL_RESERVOIR_1_PRIMARY ); R2HeatDisinfectVol = getLoadCellLargeFilteredWeight( LOAD_CELL_RESERVOIR_2_PRIMARY ); + setROPumpTargetFlowRateLPM( HEAT_DISINFECT_TARGET_RO_FLOW_LPM, HEAT_DISINFECT_MAX_RO_PRESSURE_PSI ); // Set the drain pump to control mode - setDrainPumpTargetOutletPressure( HEAT_DISINFECT_TARGET_DRAIN_PRES_PSI ); + //setDrainPumpTargetOutletPressure( HEAT_DISINFECT_TARGET_DRAIN_PRES_PSI ); // Set the RO flow to maximum pressure of 30psi since it is the maximum pressure on the RO filter // at inlet temperature > 45 C