Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -r34ed52c598042fdcfa5526e3b1d46fa09b040199 -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 34ed52c598042fdcfa5526e3b1d46fa09b040199) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -234,9 +234,7 @@ if ( ( primaryHeaterTargetTemperature >= MINIMUM_TARGET_TEMPERATURE ) && ( primaryHeaterTargetTemperature <= MAXIMUM_TARGET_TEMPERATURE ) ) { -//#ifndef DISABLE_HEATERS_AND_TEMPS hasStartPrimaryHeaterRequested = TRUE; -//#endif status = TRUE; } Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -r86eec09ab556fbd970ddcae9dc622727928ee757 -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 86eec09ab556fbd970ddcae9dc622727928ee757) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -76,6 +76,7 @@ #define TEMPERATURE_SENSORS_FPGA_ERROR_PERSISTENT_PERIOD ( 5 * MS_PER_SECOND ) ///< Temperature sensors FPGA error persistent period. #define TEMPERATURE_SENSORS_INTERNAL_ERROR_PERSISTENT_PERIOD ( 3 * MS_PER_SECOND ) ///< Temperature sensors internal error persistent period. #define FPGA_RAW_ADC_READ_INTERVAL_COUNT 8 ///< Time interval in counts to read the raw ADC reads from FPGA. +#define TEMPERATURE_SENSORS_ERROR_FLAG_PERSISTENT_PERIOD ( 5 * MS_PER_SECOND ) ///< Temperature sensors error flag persistent period. /// Temperature sensor self-test states. typedef enum tempSensors_Self_Test_States @@ -252,10 +253,15 @@ initPersistentAlarm( ALARM_ID_INLET_WATER_HIGH_TEMPERATURE, INLET_WATER_TEMPERATURE_PERSISTENCE_PERIOD, INLET_WATER_TEMPERATURE_PERSISTENCE_PERIOD ); initPersistentAlarm( ALARM_ID_INLET_WATER_LOW_TEMPERATURE, INLET_WATER_TEMPERATURE_PERSISTENCE_PERIOD, INLET_WATER_TEMPERATURE_PERSISTENCE_PERIOD ); - // Persistent alarm for temperature sensors internal error + // Persistent alarm for temperature sensors ADC error // When the FPGA read count does not increment for a period of time, it is considered as an internal error of the temperature sensors // driver. This is internal because FPGA does not error out if the FPGA read count does not increment. - initPersistentAlarm( ALARM_ID_TEMPERATURE_SENSORS_FAULT, TEMPERATURE_SENSORS_FPGA_ERROR_PERSISTENT_PERIOD, TEMPERATURE_SENSORS_FPGA_ERROR_PERSISTENT_PERIOD ); + initPersistentAlarm( ALARM_ID_DG_TEMPERATURE_SENSORS_ADC_FAULT, TEMPERATURE_SENSORS_FPGA_ERROR_PERSISTENT_PERIOD, + TEMPERATURE_SENSORS_FPGA_ERROR_PERSISTENT_PERIOD ); + + // Persistent alarm for temperature sensors internal error flag + initPersistentAlarm( ALARM_ID_DG_TEMPERATURE_SENSOR_FAULT, TEMPERATURE_SENSORS_ERROR_FLAG_PERSISTENT_PERIOD, + TEMPERATURE_SENSORS_ERROR_FLAG_PERSISTENT_PERIOD ); } /*********************************************************************//** @@ -493,8 +499,49 @@ { S32 convertedADC = (S32)( adc & MASK_OFF_U32_MSB ); - if ( TRUE == isADCReadValid( sensorIndex, fpgaError, fpgaCount ) ) + // All the sensors have ADC read and count values that have to be checked + BOOL isADCValid = isADCReadValid( sensorIndex, fpgaError, fpgaCount ); + + // Some of the temperature sensors have an MSB bit that is used as an + // error flag. This flag will be a TRUE by default. + BOOL isTemperatureNotValid = FALSE; + + switch( sensorIndex ) { + case TEMPSENSORS_LOAD_CELL_A1_B1: // 267 + case TEMPSENSORS_LOAD_CELL_A2_B2: // 279 + case TEMPSENSORS_CONDUCTIVITY_SENSOR_1: // 283 + case TEMPSENSORS_CONDUCTIVITY_SENSOR_2: // 287 + case TEMPSENSORS_OUTLET_PRIMARY_HEATER: // 291 + case TEMPSENSORS_INLET_PRIMARY_HEATER: // 295 + case TEMPSENSORS_INTERNAL_COND_TEMP_SENSOR: // 299 + case TEMPSENSORS_OUTLET_REDUNDANT: // 303 + case TEMPSENSORS_INTERNAL_THDO_RTD: // 307 + case TEMPSENSORS_INLET_DIALYSATE: // 311 + case TEMPSENSORS_INTERNAL_TDI_RTD: // 315 + { + // The MSB bit of the last byte is the error flag, so that MSB + // is shifted 31 bits to the first bit of the U32 variable. + // If that bit is a 1, there is either CRC error or Status error + // that are ored on top of each other + U32 errorBit = adc >> 31; + isTemperatureNotValid = errorBit > 0; + checkPersistentAlarm( ALARM_ID_DG_TEMPERATURE_SENSOR_FAULT, isTemperatureNotValid, sensorIndex, + TEMPERATURE_SENSORS_ERROR_FLAG_PERSISTENT_PERIOD ); + } + break; + + default: + // Do nothing. FPGA board temperature sensor does not have error flag bit + // If a wrong temperature sensor name is picked, the function that converts + // ADC counts to temperature raises an alarm. + break; + } + + // To update the moving average of a temperature sensor, both ADC and internal + // error flags must be valid + if ( ( TRUE == isADCValid ) && ( FALSE == isTemperatureNotValid ) ) + { processADCRead( sensorIndex, convertedADC ); } } @@ -557,9 +604,9 @@ } } - BOOL isThereAnError = !isFPGACountChanging || !isFPGAErrorZero; + BOOL isThereAnError = ( FALSE == isFPGACountChanging ) || ( FALSE == isFPGAErrorZero ); - checkPersistentAlarm( ALARM_ID_TEMPERATURE_SENSORS_FAULT, isThereAnError, sensorIndex, TEMPERATURE_SENSORS_FPGA_ERROR_PERSISTENT_PERIOD ); + checkPersistentAlarm( ALARM_ID_DG_TEMPERATURE_SENSORS_ADC_FAULT, isThereAnError, sensorIndex, TEMPERATURE_SENSORS_FPGA_ERROR_PERSISTENT_PERIOD ); return isADCValid; } @@ -670,7 +717,7 @@ if ( ( TRUE == isLessThanZero ) || ( TRUE == isGreaterThanFullScale ) ) { tempSensorsSelfTestResult = SELF_TEST_STATUS_FAILED; - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TEMPERATURE_SENSORS_FAULT, TEMPSENSORS_SELF_TEST_ADC_CHECK ); + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_TEMPERATURE_SENSORS_ADC_FAULT, TEMPSENSORS_SELF_TEST_ADC_CHECK ); } return TEMPSENSORS_SELF_TEST_COMPLETE; Index: firmware/App/DGCommon.h =================================================================== diff -u -r7e632c636be41c139d2d97cc845298ff98ff66ed -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/DGCommon.h (.../DGCommon.h) (revision 7e632c636be41c139d2d97cc845298ff98ff66ed) +++ firmware/App/DGCommon.h (.../DGCommon.h) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -49,7 +49,6 @@ #define IGNORE_DRAIN_PUMP_MONITOR 1 #define IGNORE_HEATERS_MONITOR 1 #define IGNORE_RO_PUMP_MONITOR 1 - #define IGNORE_DISINFECT_RSRVR_TIMEOUT 1 #define DISABLE_RO_RATIO_CHECK 1 #define DISABLE_COND_SENSOR_CHECK 1 #define DISABLE_MIXING 1 Index: firmware/App/Modes/ModeChemicalDisinfect.c =================================================================== diff -u -rc0700a4503f28288f16070634bb87f4eccb2568c -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision c0700a4503f28288f16070634bb87f4eccb2568c) +++ firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -15,6 +15,7 @@ * ***************************************************************************/ +#include "ConcentratePumps.h" #include "ConductivitySensors.h" #include "DrainPump.h" #include "Heaters.h" @@ -49,7 +50,7 @@ #define MAX_START_STATE_TEMP_SENSORS_DIFF_C 3.0 ///< Max start state TDi and TRo difference tolerance in C. // Drain R1 & R2 states defines -#define DRAIN_PUMP_TARGET_RPM 1800 ///< Drain pump target RPM during drain. +#define DRAIN_PUMP_TARGET_RPM 2100 ///< Drain pump target RPM during drain. #define RSRVRS_INITIAL_DRAIN_TIME_OUT_MS ( 2* SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 initial drain time out in milliseconds. #define DRAIN_WEIGHT_UNCHANGE_TIMEOUT ( 6 * MS_PER_SECOND ) ///< Time period of unchanged weight during draining before timeout. @@ -77,18 +78,29 @@ #define CHEM_DISINFECT_TARGET_RO_FLOW_LPM 0.9 ///< Chemical disinfect target RO flow rate in L/min. TODO original value was 0.8 #define CHEM_DISINFECT_MAX_RO_PRESSURE_PSI 130 ///< Chemical disinfect maximum RO pressure in psi. #define CHEM_DISINFECT_TARGET_DRAIN_PRES_PSI 10.0 ///< Chemical disinfect target drain outlet pressure in psi. -#define CHEM_DISINFECT_TIME_MS ( 1 * SEC_PER_MIN * MS_PER_SECOND ) ///< Chemical disinfect time for each section in milliseconds. TODO original time was 10 minutes +#define CHEM_DISINFECT_TIME_MS ( 20 * SEC_PER_MIN * MS_PER_SECOND ) ///< Chemical disinfect time for each section in milliseconds. TODO original time was 10 minutes #define CHEM_DISINFECT_START_TEMP_TIMOUT_MS ( 4 * MIN_PER_HOUR * SEC_PER_MIN * MS_PER_SECOND ) ///< Chemical disinfect reaching to minimum temperature timeout in milliseconds. TODO figure out this timeout #define RSRVRS_TARGET_VOL_OUT_TIMEOUT_MS ( 0.5 * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 maximum volume out of range timeout during chemical disinfect. TODO change this to 5 seconds #define RSRVRS_MAX_TARGET_VOL_CHANGE_ML 600.0 ///< Reservoirs 1 & 2 maximum allowed volume change when full during chemical disinfect. TODO original value is 100 mL #define POST_CHEM_DISINFECT_WAIT_TIME_MS ( 1 * SEC_PER_MIN * MS_PER_SECOND ) ///< Chemical disinfect final wait time before flushing the system in milliseconds. +// Prime acid line +#define PRIME_ACID_LINE_TIMEOUT_MS ( 2 * SEC_PER_MIN * MS_PER_SECOND ) ///< Priming acid line timeout in milliseconds. +#define CONC_PUMP_PRIME_SPEED_ML_PER_MIN 40.0 ///< Concentrate pump prime speed in ml/min. +#define MIN_ACID_CONDUCTIVITY_US_PER_CM 2000.0 ///< Minimum conductivity that indicates acid is in the line in uS/cm. +#define PRIME_ACID_STEADY_CONDUCTIVITY_TIME_MS ( ( 2 * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) ///< Minimum time that a steady conductivity of acid must be read in milliseconds. + +// Fill with disinfectant and water +#define MIN_RO_FLOW_FOR_CONC_PUMP_MIXING_LPM 0.3 ///< Minimum RO flow rate that is need to be able to turn on the concentrate pump for mixing. + // Fill heat up #define CHEM_DISINFECT_TARGET_TEMPERATURE_C 21.0 ///< Chemical disinfect target water temperature in C. // Post disinfect rinses #define NUM_OF_POST_DISINFECT_RINSES 1 ///< Number of rinses after a chemical disinfect. +static const F32 ACID_TO_WATER_MIXING_RATIO = ( 1.0 / 70.0 ); ///< Acid to water mixing ratio for chemical disinfect. + /// Cancellation paths typedef enum Cancellation_modes { @@ -113,6 +125,7 @@ static DG_CHEM_DISINFECT_STATE_T chemDisinfectState = DG_CHEM_DISINFECT_STATE_START; ///< Currently active chemical disinfect state. static DG_CHEM_DISINFECT_STATE_T prevChemDisinfectState = DG_CHEM_DISINFECT_STATE_START; ///< Previous active heat disinfect state before alarm. +static DG_CHEM_DISINFECT_UI_STATE_T chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_START; ///< Currently active chemical disinfect UI state. static U32 overallChemDisinfectTimer = 0; ///< Chemical disinfect cycle total timer. static U32 stateTimer = 0; ///< Chemical disinfect state timer to be used in different states. static U32 stateTrialCounter = 0; ///< Chemical disinfect state trial counter to be used for retries in different states. @@ -132,6 +145,7 @@ static U32 rsrvrFillStableTimeCounter = 0; ///< Reservoirs fill stable time counter. static ALARM_ID_T alarmDetectedPendingTrigger; ///< Chemical disinfect alarm to raise. static U32 numberOfPostDisinfectRinses = NUM_OF_POST_DISINFECT_RINSES; ///< Number of times to rinse the fluid path after chemical disinfect. +static U32 primeAcidSteadyStateCounter = 0; // ********** private function prototypes ********** @@ -144,7 +158,9 @@ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectFlushR2AndDrainR1State( void ); static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectFlushDrainR2State( void ); static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectFlushDrainR1State( void ); +static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectPrimeAcidLineState( void ); static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectFillWithWaterAndDisinfectantState( void ); +static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectRemoveAcidBottleFromUIState( void ); static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectDisinfectR1ToR2State( void ); static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectFillR2WithDisinfectantState( void ); static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectDisinfectR2ToR1State( void ); @@ -174,7 +190,8 @@ * stateTrialCounter, areTempSensorsInRange, rsrvr1Status, rsrvr2Status, * R1ChemDisinfectVol, R2ChemDisinfectVol, overallChemDisinfectTimer, * cancellationMode, rsrvrFillStableTimeCounter, prevChemDisinfectState - * isPartialDisinfectInProgress, numberOfPostDisinfectRinses + * isPartialDisinfectInProgress, numberOfPostDisinfectRinses, + * primeAcidSteadyStateCounter, chemDisinfectUIState * @return none *************************************************************************/ void initChemicalDisinfectMode( void ) @@ -194,6 +211,8 @@ rsrvrFillStableTimeCounter = 0; isPartialDisinfectInProgress = FALSE; numberOfPostDisinfectRinses = NUM_OF_POST_DISINFECT_RINSES; + primeAcidSteadyStateCounter = 0; + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_START; } /*********************************************************************//** @@ -259,10 +278,18 @@ chemDisinfectState = handleChemicalDisinfectFlushDrainR1State(); break; + case DG_CHEM_DISINFECT_STATE_PRIME_ACID_LINE: + chemDisinfectState = handleChemicalDisinfectPrimeAcidLineState(); + break; + case DG_CHEM_DISINFECT_STATE_FILL_WITH_WATER_AND_DISINFECTANT: chemDisinfectState = handleChemicalDisinfectFillWithWaterAndDisinfectantState(); break; + case DG_CHEM_DISINFECT_STATE_REMOVE_ACID_BOTTLE_FROM_UI: + chemDisinfectState = handleChemicalDisinfectRemoveAcidBottleFromUIState(); + break; + case DG_CHEM_DISINFECT_STATE_DISINFECT_R1_TO_R2: chemDisinfectState = handleChemicalDisinfectDisinfectR1ToR2State(); break; @@ -378,13 +405,16 @@ * @details Inputs: alarm, rsrvrFillStableTimeCounter, rsrvr1Status, * stateTimer * @details Outputs: alarm, rsrvrFillStableTimeCounter, rsrvr1Status, - * stateTimer + * stateTimer, chemDisinfectUIState * @return next state of the chemical disinfect state machine *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectStartState( void ) { DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_DRAIN_R1; + // Set the chemical disinfect that is published on the UI + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_START; + // Start overall chemical disinfect timer overallChemDisinfectTimer = getMSTimerCount(); @@ -413,13 +443,8 @@ // Request a tare for reservoir 1 tareReservoir(); -#ifndef V_2_SYSTEM // Set the actuators to drain R1 setValveState( VRD1, VALVE_STATE_OPEN ); -#else - // Set the actuators to drain R1 - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); rsrvrFillStableTimeCounter = 0; @@ -438,13 +463,17 @@ * transition is finished within the time, it transitions to the next state, * otherwise, it transitions to basic cancellation path. * @details Inputs: stateTimer, rsrvr1Status, rsrvr2Status, isThisLastDrain - * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status + * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status, + * chemDisinfectUIState * @return next state of the chemical disinfect state machine *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectDrainR1State( void ) { DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_DRAIN_R1; + // Set the chemical disinfect that is published on the UI + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_FLUSH_BEFORE_DISINFECT; + if ( DG_RESERVOIR_ABOVE_TARGET == rsrvr1Status ) { rsrvr1Status = getRsrvrDrainStatus( DG_RESERVOIR_1, DRAIN_WEIGHT_UNCHANGE_TIMEOUT, RSRVRS_INITIAL_DRAIN_TIME_OUT_MS ); @@ -453,18 +482,18 @@ { if ( TRUE == isThisLastDrain ) { + // Set the chemical disinfect that is published on the UI + // This is the final drain of chemical disinfect + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_FLUSH_AFTER_DISINFECT; + // Done with draining signalDrainPumpHardStop(); // Set the valves to flush the recirculation line setValveState( VPI, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); // Done with draining R1 setValveState( VRD1, VALVE_STATE_CLOSED ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); @@ -486,13 +515,9 @@ // Request a tare for reservoir 2 tareReservoir(); -#ifndef V_2_SYSTEM + // Done with draining R1 + setValveState( VRD1, VALVE_STATE_CLOSED ); setValveState( VRD2, VALVE_STATE_OPEN ); -#else - // Set the actuators to drain R2. - // NOTE: Drain pump is already on and VDr is already on drain state - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif state = DG_CHEM_DISINFECT_STATE_DRAIN_R2; } @@ -516,7 +541,8 @@ * state, otherwise, it transitions to basic cancellation path. * @details Inputs: stateTimer, rsrvr2Status, isThisLastDrain, * stateTrialCounter - * @details Outputs: stateTimer, rsrvr2Status, stateTrialCounter + * @details Outputs: stateTimer, rsrvr2Status, stateTrialCounter, + * chemDisinfectUIState * @return next state of the chemical disinfect state machine *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectDrainR2State( void ) @@ -531,21 +557,19 @@ { if ( TRUE == isThisLastDrain ) { -#ifndef V_2_SYSTEM + // Set the chemical disinfect that is published on the UI + // This is the final drain of chemical disinfect + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_FLUSH_AFTER_DISINFECT; + setValveState( VRD1, VALVE_STATE_OPEN ); setValveState( VRD2, VALVE_STATE_CLOSED ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; state = DG_CHEM_DISINFECT_STATE_DRAIN_R1; } else { signalDrainPumpHardStop(); -#ifndef V_2_SYSTEM setValveState( VRD2, VALVE_STATE_CLOSED ); -#endif setValveState( VPI, VALVE_STATE_OPEN ); stateTrialCounter = 0; stateTimer = getMSTimerCount(); @@ -585,11 +609,7 @@ if ( ( getTemperatureValue( TEMPSENSORS_INLET_PRIMARY_HEATER ) > MIN_INLET_TEMPERATURE_C ) && ( getConductivityValue( CONDUCTIVITYSENSORS_CPI_SENSOR ) <= MAX_INLET_CONDUCTIVITY_US_PER_CM ) ) { -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setROPumpTargetFlowRate( RO_PUMP_TARGET_FLUSH_FILL_FLOW_RATE_LPM, MAX_RO_PUMP_FLUSH_FILL_PRESSURE_PSI ); stateTimer = getMSTimerCount(); stateTrialCounter = 0; @@ -737,11 +757,7 @@ setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_OPEN ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); stateTimer = getMSTimerCount(); @@ -792,6 +808,8 @@ { // Done with draining R1 signalDrainPumpHardStop(); + + setValveState( VRD1, VALVE_STATE_CLOSED ); } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { @@ -832,14 +850,8 @@ // Set the valves to drain R2 and no fill setValveState( VPI, VALVE_STATE_CLOSED ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); - setValveState( VRD1, VALVE_STATE_CLOSED ); setValveState( VRD2, VALVE_STATE_OPEN ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); @@ -886,11 +898,8 @@ } else if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) { -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_OPEN ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif + setValveState( VRD2, VALVE_STATE_CLOSED ); // Start the timer for drain timeout stateTimer = getMSTimerCount(); rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; @@ -931,34 +940,15 @@ // Done with draining the reservoirs signalDrainPumpHardStop(); - // Prepare for filling the reservoirs and heating the water - setValveState( VPI, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); - setValveState( VRD1, VALVE_STATE_CLOSED ); - setValveState( VRD2, VALVE_STATE_CLOSED ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif - setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); - setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); - setValveState( VRI, VALVE_STATE_R2_C_TO_NC ); - setValveState( VRF, VALVE_STATE_R1_C_TO_NC ); + // The bicarb line is used to inject the acid into the fluid path during chemical disinfect + requestConcentratePumpsOn( CONCENTRATEPUMPS_CP2_BICARB ); - // Turn on the RO pump - setROPumpTargetFlowRate( RO_PUMP_TARGET_FLUSH_FILL_FLOW_RATE_LPM, MAX_RO_PUMP_FLUSH_FILL_PRESSURE_PSI ); + // Set the concentrate pump to run at a constant speed during priming + setConcentratePumpTargetSpeed( CONCENTRATEPUMPS_CP2_BICARB, CONC_PUMP_PRIME_SPEED_ML_PER_MIN ); - // Start heating the water while we are filling up the rsrvrs - setPrimaryHeaterTargetTemperature( CHEM_DISINFECT_TARGET_TEMPERATURE_C ); - startPrimaryHeater(); - - rsrvr1Status = DG_RESERVOIR_BELOW_TARGET; - rsrvr2Status = DG_RESERVOIR_BELOW_TARGET; - // Start the timer for drain timeout stateTimer = getMSTimerCount(); - state = DG_CHEM_DISINFECT_STATE_FILL_WITH_WATER_AND_DISINFECTANT; + state = DG_CHEM_DISINFECT_STATE_PRIME_ACID_LINE; } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { @@ -971,21 +961,103 @@ /*********************************************************************//** * @brief + * The handleChemicalDisinfectPrimeAcidLineState function handles the + * chemical disinfect prime acid line state. The state primes the acid line + * until a minimum conductivity is sensed for a period of time. The the + * function transitions to another state. If the minimum conductivity was + * not reached within the defined period of time, it transition to a + * cancellation path. + * @details Inputs: stateTimer, primeAcidSteadyStateCounter + * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status, + * prevChemDisinfectState, primeAcidSteadyStateCounter, chemDisinfectUIState + * @return next state of the chemical disinfect state machine + *************************************************************************/ +static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectPrimeAcidLineState( void ) +{ + DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_PRIME_ACID_LINE; + + // Set the chemical disinfect that is published on the UI + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_MIX_WATER_AND_ACID; + + F32 cd2Conductivity = getConductivityValue( (U32)CONDUCTIVITYSENSORS_CD2_SENSOR ); + + if ( cd2Conductivity <= MIN_ACID_CONDUCTIVITY_US_PER_CM ) + { + primeAcidSteadyStateCounter = 0; + } + else if ( cd2Conductivity > MIN_ACID_CONDUCTIVITY_US_PER_CM ) + { + // Check if the acid conductivity value has been + if ( ++primeAcidSteadyStateCounter >= PRIME_ACID_STEADY_CONDUCTIVITY_TIME_MS ) + { + // Turn off the concentrate pump for now until there is sufficient RO flow to turn it + // back for mixing + requestConcentratePumpsOff( CONCENTRATEPUMPS_CP2_BICARB ); + + // Prepare for filling the reservoirs and heating the water + setValveState( VPI, VALVE_STATE_OPEN ); + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); + setValveState( VRD1, VALVE_STATE_CLOSED ); + setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); + setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); + setValveState( VRI, VALVE_STATE_R2_C_TO_NC ); + setValveState( VRF, VALVE_STATE_R1_C_TO_NC ); + + // Turn on the RO pump + setROPumpTargetFlowRate( RO_PUMP_TARGET_FLUSH_FILL_FLOW_RATE_LPM, MAX_RO_PUMP_FLUSH_FILL_PRESSURE_PSI ); + + // Start heating the water while we are filling up the reservoirs + setPrimaryHeaterTargetTemperature( CHEM_DISINFECT_TARGET_TEMPERATURE_C ); + startPrimaryHeater(); + + rsrvr1Status = DG_RESERVOIR_BELOW_TARGET; + rsrvr2Status = DG_RESERVOIR_BELOW_TARGET; + + state = DG_CHEM_DISINFECT_STATE_FILL_WITH_WATER_AND_DISINFECTANT; + } + } + else if ( TRUE == didTimeout( stateTimer, PRIME_ACID_LINE_TIMEOUT_MS ) ) + { + // TODO transition to cancellation path + prevChemDisinfectState = state; + } + + return state; +} + +/*********************************************************************//** + * @brief * The handleChemicalDisinfectFillWithWaterAndDisinfectantState function * handles the chemical disinfect fill with water state. The state fills * reservoir 1 until it overflows to reservoir 2. If the filling process * times out, it transitions to water cancellation state, otherwise, it * transitions to next state. The levels of the reservoirs are recorded to * be monitored during chemical disinfect. - * @details Inputs: stateTimer, rsrvr1Status, rsrvr2Status, rsrvrsVolMonitorTimer - * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status, R1ChemDisinfectVol - * R2ChemDisinfectVol, rsrvrsVolMonitorTimer + * @details Inputs: stateTimer, rsrvr1Status, rsrvr2Status, + * rsrvrsVolMonitorTimer + * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status, + * R1ChemDisinfectVol, R2ChemDisinfectVol, rsrvrsVolMonitorTimer * @return next state of the chemical disinfect state machine *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectFillWithWaterAndDisinfectantState( void ) { DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_FILL_WITH_WATER_AND_DISINFECTANT; + // Get the flow rate that is used for mixing + F32 measuredROFlowRate = getMeasuredROFlowRate(); + + // If the flow is less than the minimum, request the concentrate pump to be on but do + // control it. + if ( measuredROFlowRate < MIN_RO_FLOW_FOR_CONC_PUMP_MIXING_LPM ) + { + requestConcentratePumpsOn( CONCENTRATEPUMPS_CP2_BICARB ); + } + else + { + F32 acidCP2PumpFlowRate = ACID_TO_WATER_MIXING_RATIO * measuredROFlowRate * ML_PER_LITER; + setConcentratePumpTargetSpeed( CONCENTRATEPUMPS_CP2_BICARB, acidCP2PumpFlowRate ); + } + // First reservoir 1 must be full if ( DG_RESERVOIR_BELOW_TARGET == rsrvr1Status ) { @@ -1002,15 +1074,14 @@ // Set the valves to drain R2 and no fill setValveState( VPI, VALVE_STATE_CLOSED ); setValveState( VBF, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRD2, VALVE_STATE_OPEN ); -#else - setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); -#endif setValveState( VDR, VALVE_STATE_RECIRC_C_TO_NC ); setValveState( VRC, VALVE_STATE_RECIRC_C_TO_NC ); + // Done with mixing acid + requestConcentratePumpsOff( CONCENTRATEPUMPS_CP2_BICARB ); + // Set the drain pump to control mode setDrainPumpTargetOutletPressure( CHEM_DISINFECT_TARGET_DRAIN_PRES_PSI ); @@ -1023,7 +1094,7 @@ stateTimer = getMSTimerCount(); rsrvrsVolMonitorTimer = getMSTimerCount(); - state = DG_CHEM_DISINFECT_STATE_DISINFECT_R1_TO_R2; + state = DG_CHEM_DISINFECT_STATE_REMOVE_ACID_BOTTLE_FROM_UI; } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) { @@ -1042,21 +1113,50 @@ /*********************************************************************//** * @brief + * The handleChemicalDisinfectRemoveAcidBottleFromUIState function + * handles the chemical disinfect remove acid bottle from UI state. + * The state fills sends a command to the UI to prompt the user to remove + * the acid bottle and shut the acid and bicarb line. The state continues + * waiting in this state until the user confirms that the bottle has been + * removed and acid and bicarb lines are closed. + * @details Inputs: TODO fill up + * @details Outputs: chemDisinfectUIState TODO fill up + * @return next state of the chemical disinfect state machine + *************************************************************************/ +static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectRemoveAcidBottleFromUIState( void ) +{ + DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_REMOVE_ACID_BOTTLE_FROM_UI; + + // Set the chemical disinfect that is published on the UI + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_REMOVE_ACID; + + // TODO fill up. We should wait for the user until the acid bottle is removed and it is confirmed by the user + state = DG_CHEM_DISINFECT_STATE_DISINFECT_R1_TO_R2; + + return state; +} + +/*********************************************************************//** + * @brief * The handleChemicalDisinfectDisinfectR1ToR2State function handles the * chemical disinfect R1 to R2 state. The state runs reservoir 1 to reservoir 2 * chemical disinfect. If the reservoirs leak or it cannot reach to temperature * within a certain period of time, it transitions to water cancellation. * If chemical disinfect reservoir 1 to reservoir 2 is completed, it * transitions to the next state. * @details Inputs: stateTimer, rsrvr1Status, rsrvr2Status - * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status + * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status, + * chemDisinfectUIState * @return next state of the chemical disinfect state machine *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectDisinfectR1ToR2State( void ) { DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_DISINFECT_R1_TO_R2; CHEM_DISINFECT_STATUS_T status = getChemicalDisinfectStatus(); + // Set the chemical disinfect that is published on the UI + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_DISINFECT_DEVICE; + switch ( status ) { case CHEM_DISINFECT_RSRVRS_LEAK_TIMEOUT: @@ -1068,12 +1168,8 @@ //TODO turn off CP1 and CP2 // Set the valves to transfer hot water from R1 to R2 and fill up R2. setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_OPEN ); setValveState( VRD2, VALVE_STATE_CLOSED ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); // Although there is fluid in both reservoirs, but they are set to empty @@ -1128,21 +1224,17 @@ state = DG_CHEM_DISINFECT_STATE_DISINFECT_R2_TO_R1; } -#ifdef IGNORE_DISINFECT_RSRVR_TIMEOUT else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) { prevChemDisinfectState = state; state = DG_CHEM_DISINFECT_STATE_CANCEL_WATER_PATH; } -#endif } -#ifdef IGNORE_DISINFECT_RSRVR_TIMEOUT else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { prevChemDisinfectState = state; state = DG_CHEM_DISINFECT_STATE_CANCEL_WATER_PATH; } -#endif return state; } @@ -1207,13 +1299,10 @@ // and wait for the RO membrane to be cooled down. setValveState( VPI, VALVE_STATE_CLOSED ); setValveState( VBF, VALVE_STATE_CLOSED ); -#ifndef V_2_SYSTEM + setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); + setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRD1, VALVE_STATE_OPEN ); -#else - setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); stateTimer = getMSTimerCount(); @@ -1232,28 +1321,26 @@ * state. Otherwise, it transitions to the next state. * @details Inputs: rsrvr1Status, rsrvr2Status * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status, - * prevChemDisinfectState + * prevChemDisinfectState, chemDisinfectUIState * @return next state of the chemical disinfect state machine *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectDisinfectantDrainR1State( void ) { DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_DISINFECTANT_DRAIN_R1; + // Set the chemical disinfect that is published on the UI + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_FLUSH_AFTER_DISINFECT; + if ( DG_RESERVOIR_ABOVE_TARGET == rsrvr1Status ) { rsrvr1Status = getRsrvrDrainStatus( DG_RESERVOIR_1, DRAIN_WEIGHT_UNCHANGE_TIMEOUT, RSRVRS_INITIAL_DRAIN_TIME_OUT_MS ); } else if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) { -#ifndef V_2_SYSTEM // Done with draining reservoir 1 setValveState( VRD1, VALVE_STATE_CLOSED ); // Set the drain valve to reservoir 2 setValveState( VRD2, VALVE_STATE_OPEN ); -#else - // Set the drain valve to reservoir 2 - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; stateTimer = getMSTimerCount(); state = DG_CHEM_DISINFECT_STATE_DISINFECTANT_DRAIN_R2; @@ -1293,16 +1380,10 @@ // Set the valves to fill up R1 and overflow to R2 setValveState( VPI, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); // Done with draining reservoir 2 setValveState( VRD2, VALVE_STATE_CLOSED ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); - setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); - setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRF, VALVE_STATE_R1_C_TO_NC ); setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); setValveState( VRI, VALVE_STATE_R2_C_TO_NC ); @@ -1363,11 +1444,7 @@ // Set the valves to rinse R2 to R1 and drain R1 setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_OPEN ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); @@ -1417,9 +1494,7 @@ { // Done with draining R1 signalDrainPumpHardStop(); -#ifndef V_2_SYSTEM - setValveState( VRD1, VALVE_STATE_CLOSED ); -#endif + setValveState( VRD1, VALVE_STATE_CLOSED ); } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { @@ -1454,15 +1529,8 @@ if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) { - // Done with filling, turn off the RO pump - signalROPumpHardStop(); - // Set the valves to rinse R2 to R1 and drain R1 -#ifndef V_2_SYSTEM setValveState( VRD2, VALVE_STATE_OPEN ); -#else - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); setValveState( VRI, VALVE_STATE_R2_C_TO_NC ); setValveState( VRF, VALVE_STATE_R1_C_TO_NC ); @@ -1471,6 +1539,7 @@ setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); // Set the reservoir status + rsrvr1Status = DG_RESERVOIR_BELOW_TARGET; rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; state = DG_CHEM_DISINFECT_STATE_RINSE_R1_TO_R2_AND_DRAIN_R2; stateTimer = getMSTimerCount(); @@ -1517,9 +1586,7 @@ { // Done with draining R2 signalDrainPumpHardStop(); -#ifndef V_2_SYSTEM setValveState( VRD2, VALVE_STATE_CLOSED ); -#endif } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) { @@ -1530,7 +1597,7 @@ // First reservoir 1 must be completely full if ( DG_RESERVOIR_BELOW_TARGET == rsrvr1Status ) { - rsrvr2Status = getRsrvrFillStatus( DG_RESERVOIR_1, RSRVRS_FULL_VOL_ML, RSRVRS_FILL_UP_TIMEOUT_MS ); + rsrvr1Status = getRsrvrFillStatus( DG_RESERVOIR_1, RSRVRS_FULL_VOL_ML, RSRVRS_FILL_UP_TIMEOUT_MS ); U32 drainPumpRPM = getTargetDrainPumpRPM(); // Keep monitoring the status of reservoir 2 as the same time @@ -1548,7 +1615,7 @@ } } // Once reservoir 1 is completely full, monitor reservoir 2 - else if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) + else if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) { rsrvr2Status = getRsrvrFillStatus( DG_RESERVOIR_2, RSRVRS_PARTIAL_FILL_VOL_ML, RSRVRS_500ML_FILL_UP_TIMEOUT_MS ); @@ -1557,11 +1624,7 @@ // Done with filling, turn off the RO pump signalROPumpHardStop(); -#ifndef V_2_SYSTEM setValveState( VRD2, VALVE_STATE_OPEN ); -#else - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif // Turn on the drain pump to drain R2 setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); @@ -1570,49 +1633,183 @@ if ( ++numberOfPostDisinfectRinses > NUM_OF_POST_DISINFECT_RINSES ) { // Set the reservoir status - rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; + rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; // This is last drain isThisLastDrain = TRUE; - state = DG_CHEM_DISINFECT_STATE_DRAIN_R1; + state = DG_CHEM_DISINFECT_STATE_DRAIN_R2; } else { - // Set the reservoir status - rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; - state = DG_CHEM_DISINFECT_STATE_RINSE_R1_TO_R2_AND_DRAIN_R2; + // Set the reservoirs' status + setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); + setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); + setValveState( VRD1, VALVE_STATE_OPEN ); + setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); + setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); + + rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; + rsrvr2Status = DG_RESERVOIR_BELOW_TARGET; + state = DG_CHEM_DISINFECT_STATE_RINSE_R2_TO_R1_AND_DRAIN_R1; } stateTimer = getMSTimerCount(); } - else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) + else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) { prevChemDisinfectState = state; state = DG_CHEM_DISINFECT_STATE_CANCEL_WATER_PATH; } } - else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) + else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { prevChemDisinfectState = state; state = DG_CHEM_DISINFECT_STATE_CANCEL_WATER_PATH; } return state; } + +/*********************************************************************//** + * @brief + * The handleChemicalDisinfectRinseCirculationState function handles the + * chemical disinfect rinse RO circulation and concentrate pumps state. + * Once the defined flush circulation time has elapsed, it transitions to + * the next state. + * @details Inputs: stateTimer + * @details Outputs: none + * @return next state of the chemical disinfect state machine + *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectRinseCirculationState( void ) { + DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_RINSE_CIRCULATION; + if ( TRUE == didTimeout( stateTimer, FLUSH_CICRCULATION_WAIT_TIME_MS ) ) + { + state = DG_CHEM_DISINFECT_STATE_COMPLETE; + } + + return state; } + +/*********************************************************************//** + * @brief + * The handleChemicalDisinfectCancelModeBasicPathState function handles the + * chemical disinfect cancel mode basic path state. The state sets the state + * to complete and raises an alarm. + * @details Inputs: none + * @details Outputs: cancellationMode, chemDisinfectUIState + * @return next state of the heat disinfect state machine + *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectCancelModeBasicPathState( void ) { + DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_CANCEL_BASIC_PATH; + // Set the chemical disinfect that is published on the UI + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_CANCEL_DISINFECT; + + // Set the cancellation mode + cancellationMode = CANCELLATION_MODE_BASIC; + + failChemicalDisinfect(); + + return state; } + +/*********************************************************************//** + * @brief + * The handleChemicalDisinfectCancelModeWaterPathState function handles the + * chemical disinfect cancel mode cold water path state. The state resets all + * the actuators. + * TODO fill up as the state goes + * @details Inputs: rsrvr1Status, rsrvr2Status, cancellationMode, stateTimer + * @details Outputs: rsrvr1Status, rsrvr2Status, cancellationMode, stateTimer, + * chemDisinfectUIState + * @return next state of the chemical disinfect state machine + *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectCancelModeWaterPathState( void ) { + DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_CANCEL_WATER_PATH; + // Set the chemical disinfect that is published on the UI + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_CANCEL_DISINFECT; + + if ( CANCELLATION_MODE_NONE == cancellationMode ) + { + // Stop all the actuators first then decide who should run next + deenergizeActuators(); + + cancellationMode = CANCELLATION_MODE_WATER; + rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; + rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; + + // The drain is set to start from reservoir 2 + setValveState( VRD2, VALVE_STATE_OPEN ); + setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); + + // Start the timer for drain timeout + stateTimer = getMSTimerCount(); + } + + // If reservoir 2 is empty, set to drain reservoir 1 + if ( DG_RESERVOIR_ABOVE_TARGET == rsrvr2Status ) + { + // If the cancellation water path cannot be done, got to basic cancellation path + rsrvr2Status = getRsrvrDrainStatus( DG_RESERVOIR_2, DRAIN_WEIGHT_UNCHANGE_TIMEOUT, RSRVRS_INITIAL_DRAIN_TIME_OUT_MS ); + + if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) + { + // Set the drain valve to reservoir 1 + setValveState( VRD1, VALVE_STATE_OPEN ); + setValveState( VRD2, VALVE_STATE_CLOSED ); + } + } + // Could not drain reservoir 2. Transition to basic cancellation path + else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) + { + prevChemDisinfectState = state; + state = DG_CHEM_DISINFECT_STATE_CANCEL_BASIC_PATH; + } + + // If reservoir 2 has already been drained and reservoir 1 is empty, reset and switch to complete + if ( ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) && ( DG_RESERVOIR_ABOVE_TARGET == rsrvr1Status ) ) + { + // If the cancellation water path cannot be done, got to basic cancellation path + rsrvr1Status = getRsrvrDrainStatus( DG_RESERVOIR_1, DRAIN_WEIGHT_UNCHANGE_TIMEOUT, RSRVRS_INITIAL_DRAIN_TIME_OUT_MS ); + + if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) + { + failChemicalDisinfect(); + } + // Could not drain reservoir 1. Transition to basic cancellation path + else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) + { + prevChemDisinfectState = state; + state = DG_CHEM_DISINFECT_STATE_CANCEL_BASIC_PATH; + } + } + + return state; } + +/*********************************************************************//** + * @brief + * The handleChemicalDisinfectCompleteState function handles the chemical + * disinfect complete state. The state stops chemical disinfect and + * requests transition to mode standby. + * @details Inputs: none + * @details Outputs: chemDisinfectUIState + * @return next state of the chemical disinfect state machine + *************************************************************************/ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectCompleteState( void ) { + DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_COMPLETE; + // Set the chemical disinfect that is published on the UI + chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_COMPLETE; + + stopChemicalDisinfect(); + + return state; } /*********************************************************************//** @@ -1806,30 +2003,38 @@ if ( ++dataPublishCounter > CHEM_DISINFECT_DATA_PUB_INTERVAL ) { MODE_CHEMICAL_DISINFECT_DATA_T data; + MODE_CHEMICAL_DISINFECT_UI_DATA_T uiData; data.chemDisinfectState = (U32)chemDisinfectState; data.overallElapsedTime = calcTimeSince( overallChemDisinfectTimer ); data.stateElapsedTime = calcTimeSince( stateTimer ); data.cancellationMode = (U32)cancellationMode; - data.R1FillLevel = R1ChemDisinfectVol; - data.R2FillLevel = R2ChemDisinfectVol; // If the mode is in the actual chemical disinfect states, publish the elapsed time, otherwise publish 0 to avoid confusion if ( ( DG_CHEM_DISINFECT_STATE_DISINFECT_R1_TO_R2 == chemDisinfectState ) || ( DG_CHEM_DISINFECT_STATE_DISINFECT_R2_TO_R1 == chemDisinfectState ) ) { - data.chemDisinfectElapsedTime = calcTimeSince( chemDisinfectTimer ); + uiData.chemDisinfectElapsedTime = calcTimeSince( chemDisinfectTimer ); + data.R1FillLevel = R1ChemDisinfectVol; + data.R2FillLevel = R2ChemDisinfectVol; } else { - data.chemDisinfectElapsedTime = 0; + uiData.chemDisinfectElapsedTime = 0.0; + data.R1FillLevel = 0.0; + data.R2FillLevel = 0.0; } - data.postDisinfectTargetRinseCount = NUM_OF_POST_DISINFECT_RINSES; + data.postDisinfectTargetRinseCount = NUM_OF_POST_DISINFECT_RINSES; data.postDisinfectCurrentRinseCount = numberOfPostDisinfectRinses; + data.chemDisinfectUIState = chemDisinfectUIState; + // General data publish channel broadcastChemicalDisinfectData( &data ); + // Data publish channel to UI + broadcastChemicalDisinfectData2UI( &uiData ); + dataPublishCounter = 0; } } Index: firmware/App/Modes/ModeChemicalDisinfect.h =================================================================== diff -u -rc0700a4503f28288f16070634bb87f4eccb2568c -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Modes/ModeChemicalDisinfect.h (.../ModeChemicalDisinfect.h) (revision c0700a4503f28288f16070634bb87f4eccb2568c) +++ firmware/App/Modes/ModeChemicalDisinfect.h (.../ModeChemicalDisinfect.h) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -37,14 +37,20 @@ U32 chemDisinfectState; ///< Chemical disinfect state. U32 overallElapsedTime; ///< Overall elapsed time in chemical disinfect mode. U32 stateElapsedTime; ///< Current chemical disinfect elapsed time. - U32 chemDisinfectElapsedTime; ///< Elapsed time in just chemical disinfecting. U32 cancellationMode; ///< Chemical disinfect cancellation mode. F32 R1FillLevel; ///< Reservoir 1 level upon starting the chemical disinfect. F32 R2FillLevel; ///< Reservoir 2 level upon starting the chemical disinfect. U32 postDisinfectTargetRinseCount; ///< Target post disinfect rinse count. U32 postDisinfectCurrentRinseCount; ///< Current post disinfect rinse count. -}MODE_CHEMICAL_DISINFECT_DATA_T; + U32 chemDisinfectUIState; ///< Chemical disinfect UI state. +} MODE_CHEMICAL_DISINFECT_DATA_T; +/// Chemical disinfect UI data +typedef struct +{ + U32 chemDisinfectElapsedTime; ///< Elapsed time during chemical disinfect. +} MODE_CHEMICAL_DISINFECT_UI_DATA_T; + // ********** public function prototypes ********** void initChemicalDisinfectMode( void ); // initialize this module Index: firmware/App/Modes/ModeDrain.c =================================================================== diff -u -rebd43ef11d75ff69de2eda6aec1142858bc1237e -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Modes/ModeDrain.c (.../ModeDrain.c) (revision ebd43ef11d75ff69de2eda6aec1142858bc1237e) +++ firmware/App/Modes/ModeDrain.c (.../ModeDrain.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -34,7 +34,7 @@ // ********** private definitions ********** #define TARGET_DRAIN_PUMP_RPM 2100 ///< Target drain pump speed (in RPM). -#define DRAIN_WEIGHT_UNCHANGE_TIMEOUT ( 2 * MS_PER_SECOND ) ///< Time period of unchanged weight during draining before timeout. +#define DRAIN_WEIGHT_UNCHANGE_TIMEOUT ( 15 * MS_PER_SECOND ) ///< Time period of unchanged weight during draining before timeout. #define TARGET_RO_PRESSURE_PSI 130 ///< Target pressure for RO pump. #define TARGET_RO_FLOW_RATE_L 0.3 ///< Target flow rate for RO pump. @@ -43,6 +43,8 @@ static DG_DRAIN_STATE_T drainState = DG_DRAIN_STATE_START; ///< Currently active drain state. +static U32 tempTrans = 0; + // ********** private function prototypes ********** static DG_DRAIN_STATE_T handleDrainState( void ); @@ -71,7 +73,7 @@ // re-initialize each time we transition to drain mode initDrainMode(); -#ifndef V_2_SYSTEM +/*#ifndef V_2_SYSTEM DG_RESERVOIR_ID_T inactiveReservoir = getInactiveReservoir(); if ( DG_RESERVOIR_1 == inactiveReservoir ) @@ -82,12 +84,18 @@ { setValveState( VRD2, VALVE_STATE_OPEN ); } -#endif +#endif*/ - // set initial actuator states + // TODO test code remove + DG_RESERVOIR_ID_T inactiveReservoir = getInactiveReservoir(); + tempTrans = 0; setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); + // TODO test code remove - setDrainPumpTargetRPM( TARGET_DRAIN_PUMP_RPM ); + // set initial actuator states + //setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); TODO uncomment + + //setDrainPumpTargetRPM( TARGET_DRAIN_PUMP_RPM ); //TODO comment this for testing setROPumpTargetFlowRate( TARGET_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); } @@ -136,8 +144,27 @@ static DG_DRAIN_STATE_T handleDrainState( void ) { DG_DRAIN_STATE_T result = DG_DRAIN_STATE_DRAIN; + + // TODO test code remove DG_RESERVOIR_ID_T inactiveReservoir = getInactiveReservoir(); + if ( ++tempTrans == 20 ) + { + if ( DG_RESERVOIR_2 == inactiveReservoir ) + { + setValveState( VRD2, VALVE_STATE_OPEN ); + } + else if ( DG_RESERVOIR_1 == inactiveReservoir ) + { + setValveState( VRD1, VALVE_STATE_OPEN ); + } + } + else if ( tempTrans == 40 ) + { + setDrainPumpTargetRPM( TARGET_DRAIN_PUMP_RPM ); + } + // TODO test code remove + // if we have reached our target drain to volume (by weight) or cannot drain anymore, we are done draining - go back to re-circ mode if ( TRUE == hasTargetDrainVolumeBeenReached( inactiveReservoir, DRAIN_WEIGHT_UNCHANGE_TIMEOUT ) ) { Index: firmware/App/Modes/ModeFault.c =================================================================== diff -u -r379f78f1fad668d741b3ccf1e78c69f3fccc45b5 -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 379f78f1fad668d741b3ccf1e78c69f3fccc45b5) +++ firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -15,6 +15,7 @@ * ***************************************************************************/ +#include "ConcentratePumps.h" #include "DrainPump.h" #include "Heaters.h" #include "ModeFault.h" @@ -113,26 +114,18 @@ setValveState( VPI, VALVE_STATE_CLOSED ); setValveState( VBF, VALVE_STATE_CLOSED ); setValveState( VSP, VALVE_STATE_CLOSED ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); - -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_CLOSED ); setValveState( VRD2, VALVE_STATE_CLOSED ); -#else - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); - //TODO add the composition pumps + requestConcentratePumpsOff( CONCENTRATEPUMPS_CP1_ACID ); + requestConcentratePumpsOff( CONCENTRATEPUMPS_CP2_BICARB ); signalROPumpHardStop(); signalDrainPumpHardStop(); stopPrimaryHeater(); Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r654c5598765bb862c00a0175bdac95604c6c9b24 -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 654c5598765bb862c00a0175bdac95604c6c9b24) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -119,6 +119,10 @@ turnOnUVReactor( INLET_UV_REACTOR ); turnOnUVReactor( OUTLET_UV_REACTOR ); + // TODO remove + setPrimaryHeaterTargetTemperature( 39.0 ); + // TODO remove + startPrimaryHeater(); setROPumpTargetFlowRate( TARGET_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); } Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -r379f78f1fad668d741b3ccf1e78c69f3fccc45b5 -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 379f78f1fad668d741b3ccf1e78c69f3fccc45b5) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -48,7 +48,7 @@ #define MAX_START_STATE_TEMP_SENSORS_DIFF_C 3.0 ///< Max start state TDi and TRo difference tolerance in C. // Drain R1 & R2 states defines -#define DRAIN_PUMP_TARGET_RPM 1800 ///< Drain pump target RPM during drain. +#define DRAIN_PUMP_TARGET_RPM 2200 ///< Drain pump target RPM during drain. #define RSRVRS_INITIAL_DRAIN_TIME_OUT_MS ( 2* SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 initial drain time out in milliseconds. #define DRAIN_WEIGHT_UNCHANGE_TIMEOUT ( 6 * MS_PER_SECOND ) ///< Time period of unchanged weight during draining before timeout. @@ -73,8 +73,8 @@ #define RSRVRS_DRAIN_TIMEOUT_MS ( 2 * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 drain timeout in ms. // Fill and heat water -#define HEAT_DISINFECT_TARGET_TEMPERATURE_C 85.0 ///< Heat disinfect target water temperature in C. TODO original temperature was 85.0 -#define HEAT_DISINFECT_START_TEMPERATURE_C 81.0 ///< Heat disinfect minimum acceptable temperature in C. TODO original temperature was 81.0 +#define HEAT_DISINFECT_TARGET_TEMPERATURE_C 65.0 ///< Heat disinfect target water temperature in C. TODO original temperature was 85.0 +#define HEAT_DISINFECT_START_TEMPERATURE_C 61.0 ///< Heat disinfect minimum acceptable temperature in C. TODO original temperature was 81.0 // R1 to R2 & R2 to R1 heat disinfect circulation #define HEAT_DISINFECT_TARGET_RO_FLOW_LPM 0.9 ///< Heat disinfect target RO flow rate in L/min. TODO original value was 0.8 @@ -89,7 +89,7 @@ // Mix drain R1 and R2 #define RSRVRS_MIX_DRAIN_TIMEOUT_MS ( 20 * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 mix drain timeout in ms. #define DRAIN_PUMP_START_TIME_IN_MIX_DRAIN_MS ( 5 * MS_PER_SECOND ) ///< Time to start the drain pump at mix drain after directing the flow to drain in ms. -#define DRAIN_PUMP_RPM_IN_MIX_DRAIN 600 ///< The RPM that the drain pump should be run during mix drain. +#define DRAIN_PUMP_RPM_IN_MIX_DRAIN 1500 ///< The RPM that the drain pump should be run during mix drain. TODO the original value is 600 RPM #define MIX_DRAIN_WEIGHT_UNCHANGE_TIMEOUT ( 15 * MS_PER_SECOND ) ///< Time period of unchanged weight during mix draining before timeout. // Rinse R1 to R2 @@ -122,6 +122,7 @@ 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_START; ///< 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. @@ -420,13 +421,8 @@ setValveState( VPI, VALVE_STATE_CLOSED ); // Request a tare for reservoir 1 tareReservoir(); -#ifndef V_2_SYSTEM // Set the actuators to drain R1 setValveState( VRD1, VALVE_STATE_OPEN ); -#else - // Set the actuators to drain R1 - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); rsrvrFillStableTimeCounter = 0; @@ -465,12 +461,8 @@ // Set the valves to flush the recirculation line setValveState( VPI, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); setValveState( VRD1, VALVE_STATE_CLOSED ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); @@ -490,17 +482,11 @@ rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; // Request a tare for reservoir 2 tareReservoir(); -#ifndef V_2_SYSTEM // Done with draining R1, close it setValveState( VRD1, VALVE_STATE_CLOSED ); // Set the actuators to drain R2. // NOTE: Drain pump is already on and VDr is already on drain state setValveState( VRD2, VALVE_STATE_OPEN ); -#else - // Set the actuators to drain R2. - // NOTE: Drain pump is already on and VDr is already on drain state - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif state = DG_HEAT_DISINFECT_STATE_DRAIN_R2; } @@ -539,22 +525,16 @@ { if ( TRUE == isThisLastDrain ) { -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_OPEN ); setValveState( VRD2, VALVE_STATE_CLOSED ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; state = DG_HEAT_DISINFECT_STATE_DRAIN_R1; } else { signalDrainPumpHardStop(); -#ifndef V_2_SYSTEM // Done with draining R2, close it setValveState( VRD2, VALVE_STATE_CLOSED ); -#endif setValveState( VPI, VALVE_STATE_OPEN ); stateTrialCounter = 0; stateTimer = getMSTimerCount(); @@ -594,11 +574,7 @@ if ( ( getTemperatureValue( TEMPSENSORS_INLET_PRIMARY_HEATER ) > MIN_INLET_TEMPERATURE_C ) && ( getConductivityValue( CONDUCTIVITYSENSORS_CPI_SENSOR ) <= MAX_INLET_CONDUCTIVITY_US_PER_CM ) ) { -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setROPumpTargetFlowRate( RO_PUMP_TARGET_FLUSH_FILL_FLOW_RATE_LPM, MAX_RO_PUMP_FLUSH_FILL_PRESSURE_PSI ); stateTimer = getMSTimerCount(); stateTrialCounter = 0; @@ -745,11 +721,7 @@ setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_OPEN ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); stateTimer = getMSTimerCount(); @@ -799,10 +771,8 @@ { // Done with draining R1 signalDrainPumpHardStop(); -#ifndef V_2_SYSTEM // Close VRD1 setValveState( VRD1, VALVE_STATE_CLOSED ); -#endif } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { @@ -843,18 +813,10 @@ // Set the valves to drain R2 and no fill setValveState( VPI, VALVE_STATE_CLOSED ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); -#ifndef V_2_SYSTEM setValveState( VRD2, VALVE_STATE_OPEN ); -#else - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); // Start the timer for drain timeout stateTimer = getMSTimerCount(); @@ -898,12 +860,8 @@ } else if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) { -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_OPEN ); setValveState( VRD2, VALVE_STATE_CLOSED ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif // Start the timer for drain timeout stateTimer = getMSTimerCount(); rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; @@ -945,21 +903,13 @@ // Prepare for filling the reservoirs and heating the water setValveState( VPI, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); setValveState( VRI, VALVE_STATE_R2_C_TO_NC ); setValveState( VRF, VALVE_STATE_R1_C_TO_NC ); -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_CLOSED ); setValveState( VRD2, VALVE_STATE_OPEN ); -#else - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif // Turn on the RO pump setROPumpTargetFlowRate( RO_PUMP_TARGET_FLUSH_FILL_FLOW_RATE_LPM, MAX_RO_PUMP_FLUSH_FILL_PRESSURE_PSI ); @@ -1018,11 +968,7 @@ // Set the valves to drain R2 and no fill setValveState( VPI, VALVE_STATE_CLOSED ); setValveState( VBF, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); -#else - setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); -#endif setValveState( VDR, VALVE_STATE_RECIRC_C_TO_NC ); setValveState( VRC, VALVE_STATE_RECIRC_C_TO_NC ); @@ -1090,12 +1036,8 @@ //TODO turn off CP1 and CP2 // Set the valves to transfer hot water from R1 to R2 and fill up R2. setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_OPEN ); setValveState( VRD2, VALVE_STATE_CLOSED ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); // Although there is fluid in both reservoirs, but they are set to empty @@ -1150,21 +1092,17 @@ state = DG_HEAT_DISINFECT_STATE_DISINFECT_R2_TO_R1; } -#ifdef IGNORE_DISINFECT_RSRVR_TIMEOUT else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) { prevHeatDisinfectState = state; state = DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH; } -#endif } -#ifdef IGNORE_DISINFECT_RSRVR_TIMEOUT else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { prevHeatDisinfectState = state; state = DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH; } -#endif return state; } @@ -1228,12 +1166,8 @@ // and wait for the RO membrane to be cooled down. setValveState( VPI, VALVE_STATE_CLOSED ); setValveState( VBF, VALVE_STATE_CLOSED ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRD1, VALVE_STATE_CLOSED ); -#else - setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); -#endif stateTimer = getMSTimerCount(); state = DG_HEAT_DISINFECT_STATE_COOL_DOWN_RO_FILTER; } @@ -1254,11 +1188,14 @@ { DG_HEAT_DISINFECT_STATE_T state = DG_HEAT_DISINFECT_STATE_COOL_DOWN_RO_FILTER; - F32 ThdTemp = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); //TODO change this to actual THd sensor later + // TPo which is the temperature sensor after the heater is hottest spot + // and this temperature is monitored until it is dropped below 45 C to be able + // to run fluid through the RO filter + F32 TPoTemp = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER ); // Check if the coldest spot temperature is less than 45 C so the RO filter // can safely run fluid through - if ( ThdTemp < ROF_MIN_LOW_PRESSURE_TEMPERATURE_C ) + if ( TPoTemp < ROF_MIN_LOW_PRESSURE_TEMPERATURE_C ) { setValveState( VPI, VALVE_STATE_OPEN ); setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); @@ -1296,9 +1233,7 @@ { isDrainPumpInMixDrainOn = TRUE; -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_OPEN ); -#endif // Turn on the drain pump to drain the reservoirs in open loop mode setDrainPumpTargetRPM( DRAIN_PUMP_RPM_IN_MIX_DRAIN ); @@ -1311,15 +1246,10 @@ } else if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) { -#ifndef V_2_SYSTEM // Done with draining reservoir 1 setValveState( VRD1, VALVE_STATE_CLOSED ); // Set the drain valve to reservoir 2 setValveState( VRD2, VALVE_STATE_OPEN ); -#else - // Set the drain valve to reservoir 2 - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; stateTimer = getMSTimerCount(); @@ -1360,13 +1290,9 @@ // Set the valves to fill up R1 and overflow to R2 setValveState( VPI, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); // Done with draining reservoir 2 setValveState( VRD2, VALVE_STATE_CLOSED ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); @@ -1429,11 +1355,7 @@ // Set the valves to rinse R2 to R1 and drain R1 setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); -#ifndef V_2_SYSTEM - setValveState( VRD1, VALVE_STATE_R1_C_TO_NC ); -#else - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif + setValveState( VRD1, VALVE_STATE_OPEN ); setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); @@ -1482,9 +1404,7 @@ { // Done with draining R1 signalDrainPumpHardStop(); -#ifndef V_2_SYSTEM - setValveState( VRD1, VALVE_STATE_CLOSED ); -#endif + setValveState( VRD1, VALVE_STATE_CLOSED ); } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { @@ -1524,18 +1444,10 @@ // De-energize all the valves and set the VDr to drain R2 setValveState( VPI, VALVE_STATE_CLOSED ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); -#else - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); -#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); -#ifndef V_2_SYSTEM setValveState( VRD2, VALVE_STATE_OPEN ); -#else - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); -#endif setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); @@ -1646,11 +1558,7 @@ { // The fluid is hot so this is a mix drain. Set the VPd to direct the cold inlet fluid to drain setValveState( VPI, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); -#else - setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); -#endif targetRPM = DRAIN_PUMP_RPM_IN_MIX_DRAIN; cancellationMode = CANCELLATION_MODE_HOT; @@ -1660,6 +1568,8 @@ rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; // The drain is set to start from reservoir 2 since all the actuators have been de-energized + // Set the drain valve to reservoir 2 + setValveState( VRD2, VALVE_STATE_OPEN ); // Start the drain pump setDrainPumpTargetRPM( targetRPM ); @@ -1675,13 +1585,8 @@ if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) { -#ifndef V_2_SYSTEM // Set the drain valve to reservoir 1 setValveState( VRD1, VALVE_STATE_OPEN ); -#else - // Set the drain valve to reservoir 1 - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); -#endif } } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) @@ -1922,26 +1827,33 @@ if ( ++dataPublishCounter > HEAT_DISINFECT_DATA_PUB_INTERVAL ) { MODE_HEAT_DISINFECT_DATA_T data; + MODE_HEAT_DISINFECT_UI_DATA_T uiData; data.heatDisinfectState = (U32)heatDisinfectState; data.overallElapsedTime = calcTimeSince( overallHeatDisinfectTimer ); data.stateElapsedTime = calcTimeSince( stateTimer ); data.cancellationMode = (U32)cancellationMode; - data.R1FillLevel = R1HeatDisinfectVol; - data.R2FillLevel = R2HeatDisinfectVol; // If the mode is in the actual heat disinfect states, publish the elapsed time, otherwise publish 0 to avoid confusion - if ( DG_HEAT_DISINFECT_STATE_DISINFECT_R1_TO_R2 == heatDisinfectState || DG_HEAT_DISINFECT_STATE_DISINFECT_R2_TO_R1 == heatDisinfectState ) + if ( ( DG_HEAT_DISINFECT_STATE_DISINFECT_R1_TO_R2 == heatDisinfectState ) || + ( DG_HEAT_DISINFECT_STATE_DISINFECT_R2_TO_R1 == heatDisinfectState ) ) { - data.heatDisinfectElapsedTime = calcTimeSince( heatDisinfectTimer ); + uiData.heatDisinfectElapsedTime = calcTimeSince( heatDisinfectTimer ); + data.R1FillLevel = R1HeatDisinfectVol; + data.R2FillLevel = R2HeatDisinfectVol; } else { - data.heatDisinfectElapsedTime = 0; + uiData.heatDisinfectElapsedTime = 0; + data.R1FillLevel = 0.0; + data.R2FillLevel = 0.0; } broadcastHeatDisinfectData( &data ); + // Publish data to UI + broadcastHeatDisinfectData2UI( &uiData ); + dataPublishCounter = 0; } } Index: firmware/App/Modes/ModeHeatDisinfect.h =================================================================== diff -u -rfba89d67dd2bef913e85a13563e2aa49f0e2e2f5 -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Modes/ModeHeatDisinfect.h (.../ModeHeatDisinfect.h) (revision fba89d67dd2bef913e85a13563e2aa49f0e2e2f5) +++ firmware/App/Modes/ModeHeatDisinfect.h (.../ModeHeatDisinfect.h) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -31,18 +31,23 @@ // ********** public definitions ********** -/// Heat Disinfect data publish struct +/// Heat disinfect data publish struct typedef struct { U32 heatDisinfectState; ///< Heat disinfect state. U32 overallElapsedTime; ///< Overall elapsed time in heat disinfect mode. U32 stateElapsedTime; ///< Current heat disinfect elapsed time. - U32 heatDisinfectElapsedTime; ///< Elapsed time in just heat disinfecting. U32 cancellationMode; ///< Heat disinfect cancellation mode. F32 R1FillLevel; ///< Reservoir 1 level upon starting the heat disinfect. F32 R2FillLevel; ///< Reservoir 2 level upon starting the heat disinfect. } MODE_HEAT_DISINFECT_DATA_T; +/// Heat disinfect data publish struct +typedef struct +{ + U32 heatDisinfectElapsedTime; ///< Elapsed time in just heat disinfecting. +} MODE_HEAT_DISINFECT_UI_DATA_T; + // ********** public function prototypes ********** void initHeatDisinfectMode( void ); // Initialize this module Index: firmware/App/Modes/ModeRecirculate.c =================================================================== diff -u -rc0700a4503f28288f16070634bb87f4eccb2568c -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision c0700a4503f28288f16070634bb87f4eccb2568c) +++ firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -82,12 +82,12 @@ // re-initialize each time we transition to re-circulate mode initRecirculateMode(); + stopPrimaryHeater(); + // set initial actuator states setValveState( VSP, VALVE_STATE_CLOSED ); setValveState( VPI, VALVE_STATE_OPEN ); -#ifndef V_2_SYSTEM setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); -#endif setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -rebbb1f85550a1f9b8f946655f7b2b63f76fbf67d -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision ebbb1f85550a1f9b8f946655f7b2b63f76fbf67d) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -56,7 +56,7 @@ /* SERV */{ DG_MODE_FAUL, DG_MODE_SERV, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG }, /* INIT */{ DG_MODE_FAUL, DG_MODE_NLEG, DG_MODE_INIT, DG_MODE_STAN, DG_MODE_SOLO, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG }, /* STAN */{ DG_MODE_FAUL, DG_MODE_SERV, DG_MODE_NLEG, DG_MODE_STAN, DG_MODE_SOLO, DG_MODE_CIRC, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_FLUS, DG_MODE_HEAT, DG_MODE_CHEM }, - /* SOLO */{ DG_MODE_FAUL, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_STAN, DG_MODE_SOLO, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_FLUS, DG_MODE_HEAT, DG_MODE_NLEG }, + /* SOLO */{ DG_MODE_FAUL, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_STAN, DG_MODE_SOLO, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_FLUS, DG_MODE_HEAT, DG_MODE_CHEM /*DG_MODE_NLEG*/ }, // TODO for testing only /* CIRC */{ DG_MODE_FAUL, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_STAN, DG_MODE_NLEG, DG_MODE_CIRC, DG_MODE_FILL, DG_MODE_DRAI, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG }, /* FILL */{ DG_MODE_FAUL, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_STAN, DG_MODE_NLEG, DG_MODE_CIRC, DG_MODE_FILL, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG }, /* DRAI */{ DG_MODE_FAUL, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_STAN, DG_MODE_NLEG, DG_MODE_CIRC, DG_MODE_NLEG, DG_MODE_DRAI, DG_MODE_NLEG, DG_MODE_NLEG, DG_MODE_NLEG }, Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r9c310aee18d85fe28b2f096cd3d61bd8df17937f -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 9c310aee18d85fe28b2f096cd3d61bd8df17937f) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -446,20 +446,7 @@ { BOOL result = FALSE; - F32 loadcellWeight = 0.0; - - // TODO remove this code once the load cell is repaired - if ( DG_RESERVOIR_1 == reservoirId ) - { - loadcellWeight = getLoadCellSmallFilteredWeight( LOAD_CELL_RESERVOIR_1_BACKUP ); - } - else - { - loadcellWeight = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); - } - // TODO remove the above code the load cell is repaired - - //F32 const loadcellWeight = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); + F32 const loadcellWeight = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); U32 const targetDrainVolume = getReservoirDrainVolumeTargetMl(); if ( loadcellWeight < reservoirLowestWeight[ reservoirId ] ) Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rcec14e1b1b636760fcd44ab35f3f45a71a79b776 -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision cec14e1b1b636760fcd44ab35f3f45a71a79b776) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -1077,6 +1077,62 @@ /*********************************************************************//** * @brief + * The broadcastChemicalDisinfectData2UI function sends out the chemical + * disinfect mode data to the UI. + * @details Inputs: none + * @details Outputs: chemical disinfect UI data msg constructed and queued + * @param chemDisinfectUIData which is flush msg constructed and queued + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL broadcastChemicalDisinfectData2UI( MODE_CHEMICAL_DISINFECT_UI_DATA_T *chemDisinfectUIData ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_CHEM_DISINFECT_TO_UI_DATA_PUBLISH; + msg.hdr.payloadLen = sizeof( MODE_CHEMICAL_DISINFECT_UI_DATA_T ); + + memcpy( payloadPtr, chemDisinfectUIData, sizeof( MODE_CHEMICAL_DISINFECT_UI_DATA_T ) ); + + // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_DG_2_UI, ACK_NOT_REQUIRED ); + + return result; +} + +/*********************************************************************//** + * @brief + * The broadcastChemicalDisinfectData2UI function sends out the heat + * disinfect mode data to the UI. + * @details Inputs: none + * @details Outputs: heat disinfect UI data msg constructed and queued + * @param heatDisinfectUIData which is flush msg constructed and queued + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL broadcastHeatDisinfectData2UI( MODE_HEAT_DISINFECT_UI_DATA_T *heatDisinfectUIData ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_HEAT_DISINFECT_TO_UI_DATA_PUBLISH; + msg.hdr.payloadLen = sizeof( MODE_HEAT_DISINFECT_UI_DATA_T ); + + memcpy( payloadPtr, heatDisinfectUIData, sizeof( MODE_HEAT_DISINFECT_UI_DATA_T ) ); + + // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_DG_2_UI, ACK_NOT_REQUIRED ); + + return result; +} + +/*********************************************************************//** + * @brief * The sendDGSystemRecord function sends out the DG system record. * @details Inputs: none * @details Outputs: DG system record msg constructed and queued Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r86eec09ab556fbd970ddcae9dc622727928ee757 -r8a4182663ef6b12e3fd6414c0c14158943cd4ce1 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 86eec09ab556fbd970ddcae9dc622727928ee757) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 8a4182663ef6b12e3fd6414c0c14158943cd4ce1) @@ -118,6 +118,12 @@ // MSG_ID_DG_CHEM_DISINFECT_DATA BOOL broadcastChemicalDisinfectData( MODE_CHEMICAL_DISINFECT_DATA_T *chemDisinfectData ); +// MSG_ID_DG_CHEM_DISINFECT_TIME_TO_UI_DATA_PUBLISH +BOOL broadcastChemicalDisinfectData2UI( MODE_CHEMICAL_DISINFECT_UI_DATA_T *chemDisinfectUIData ); + +// MSG_ID_DG_HEAT_DISINFECT_TO_UI_DATA_PUBLISH +BOOL broadcastHeatDisinfectData2UI( MODE_HEAT_DISINFECT_UI_DATA_T *heatDisinfectUIData ); + // MSG_ID_DG_COMMAND_RESPONSE void sendCommandResponseMsg( DG_CMD_RESPONSE_T *cmdResponsePtr );