Index: firmware/App/Modes/ModeChemicalDisinfect.c =================================================================== diff -u -r8f5a1b18748e7461bb657ef72ab6d5f77e1532b8 -r965a35a61959999274bbff47c74e439639d32b1d --- firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision 8f5a1b18748e7461bb657ef72ab6d5f77e1532b8) +++ firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision 965a35a61959999274bbff47c74e439639d32b1d) @@ -91,7 +91,7 @@ #define RO_PUMP_PRIME_DISINECTANT_FLOW_RATE_LPM 0.8F ///< ROP flow rate for disinfectant prime #define MAX_RO_PUMP_PRIME_DISINFECTANT_PRESSURE_PSI 130.0F ///< ROP max pressure for disinfectant prime #define DISINFECTANT_MIX_RATIO_PRIME 19.0F ///< Disinfectant mixing ratio during prime, water/disinfectant. -#define PRIME_ACID_MINIMUM_PRIME_TIMEOUT_MS ( 60 * MS_PER_SECOND ) ///< Prime acid minimum prime timeout in milliseconds. +#define PRIME_ACID_MINIMUM_PRIME_TIME_MS ( 60 * MS_PER_SECOND ) ///< Prime acid minimum prime time in milliseconds. // Stabilize disinfectant mixing state defines #define MAX_ALLOWED_DISINFECTANT_FLUSH_PERIODS 4 ///< Number of allowed periods to check conductivity and temperature in disinfectant flush state @@ -135,7 +135,7 @@ #define MAX_DRP_VOLUME_CONTROL_RPM 1500.0F ///< Maximum DRP RPM for volume control. The maximum recommended value is 2400 RPM #define ACID_MOVING_AVG_NUM_OF_SAMPLES 30 ///< Acid moving average number of samples. -#define ACID_DATA_COLLECTION_TIMEOUT_MS ( 0.5F * MS_PER_SECOND ) ///< Acid data collection timeout in milliseconds. +#define ACID_DATA_COLLECTION_TIME_MS ( 0.5F * MS_PER_SECOND ) ///< Acid data collection time in milliseconds. /// Non-volatile write structure typedef struct @@ -703,16 +703,8 @@ // Check if the flush circulation time has elapsed and the temperature sensors are not in range yet if ( TRUE == didTimeout( stateTimer, flushCircWaitTime ) ) { - F32 TPoTemp = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER ); - F32 TD2Temp = getTemperatureValue( TEMPSENSORS_CONDUCTIVITY_SENSOR_2 ); - -#ifndef _RELEASE_ - if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_USING_TPO_FOR_PRIMARY_HEATER_CONTROL ) ) - { - TD2Temp = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER ); - } -#endif - + F32 TPoTemp = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER ); + F32 TD2Temp = getTemperatureValue( TEMPSENSORS_CONDUCTIVITY_SENSOR_2 ); F32 avgTemp = ( TPoTemp + TD2Temp ) / NUM_OF_TEMP_SENSORS_TO_AVG; F32 cd2CondUSPCM = getConductivityValue( (U32)CONDUCTIVITYSENSORS_CD2_SENSOR ); F32 cpoCondUSPCM = getConductivityValue( (U32)CONDUCTIVITYSENSORS_CPO_SENSOR ); @@ -722,6 +714,13 @@ BOOL isCPoOut = FALSE; #ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_USING_TPO_FOR_PRIMARY_HEATER_CONTROL ) ) + { + TD2Temp = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER ); + } +#endif + +#ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_TEMPERATURE_SENSORS_ALARM ) != SW_CONFIG_ENABLE_VALUE ) #endif { @@ -793,7 +792,7 @@ handleDisinfectantMixing( getMeasuredFlowRateLPM( RO_FLOW_SENSOR ) * ML_PER_LITER, disinfectantMixRatio ); - if ( TRUE == didTimeout( stateTimer, PRIME_ACID_MINIMUM_PRIME_TIMEOUT_MS ) ) + if ( TRUE == didTimeout( stateTimer, PRIME_ACID_MINIMUM_PRIME_TIME_MS ) ) { #ifndef _RELEASE_ if ( nelsonSupport != NELSON_CHEM_DISINFECT ) @@ -840,9 +839,10 @@ * within the specified range within the specified time, the function transitions * to another state. If the minimum conductivity and temperature are not * reached within the defined period of time, it transition to a cancellation path. - * @details Inputs: stateTimer, primeAcidSteadyStateCounter, - * temperature, conductivity, disinfectNVOps - * @details Outputs: stateTimer, prevChemDisinfectState, alarm + * @details Inputs: stateTimer, disinfectantMixRatio, stateTrialCounter + * @details Outputs: stateTimer, stateTrialCounter, rsrvr1Status, rsrvr2Status, + * chemDisinfectReservoirTime, rsrvrFillStableTimeCounter, isChemDisinfectTempAboveTarget, + * disinfectNVOps * @return next state of the chemical disinfect state machine *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectDisinfectantFlushState( void ) @@ -1019,8 +1019,10 @@ * within a certain period of time, it transitions to water cancellation. * If reservoir 2 is filled within the specified time, it * transitions to the next state. - * @details Inputs: stateTimer, rsrvr2Status - * @details Outputs: stateTimer + * @details Inputs: stateTimer, rsrvr2Status, disinfectantMixRatio + * @details Outputs: stateTimer, isRsrvrLeaking, chemDisinfectReservoirTime, + * isChemDisinfectTempAboveTarget, ischemDisinfectWarmupTargetReached, + * prevChemDisinfectState * @return next state of the chemical disinfect state machine *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectPartialDrainR1FillR2ToR1State( void ) @@ -1158,8 +1160,9 @@ * within a certain period of time, it transitions to water cancellation. * If reservoir 1 is filled within the specified time, it * transitions to the next state. - * @details Inputs: stateTimer, rsrvr1Status - * @details Outputs: stateTimer + * @details Inputs: stateTimer, rsrvr1Status, disinfectantMixRatio + * @details Outputs: stateTimer, chemDisinfectReservoirTime, isChemDisinfectTempAboveTarget, + * ischemDisinfectWarmupTargetReached, isRsrvrLeaking, prevChemDisinfectState * @return next state of the chemical disinfect state machine *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectPartialDrainR2FillR1ToR2State( void ) @@ -1807,7 +1810,7 @@ acidDataStatus.acidDataColStartTimeMS = getMSTimerCount(); acidDataStatus.acidDataColHasTimerBeenSet = TRUE; } - else if ( TRUE == didTimeout( acidDataStatus.acidDataColStartTimeMS, ACID_DATA_COLLECTION_TIMEOUT_MS ) ) + else if ( TRUE == didTimeout( acidDataStatus.acidDataColStartTimeMS, ACID_DATA_COLLECTION_TIME_MS ) ) { F32 acidCondUSPCM = getConductivityValue( CONDUCTIVITYSENSORS_CD2_SENSOR ); U32 currentIndex = acidDataStatus.acidCondSamplesNextIndex;