Index: firmware/App/Modes/ModeRecirculate.c =================================================================== diff -u -ra52e41cc2219362d433149ca034908c8763d8378 -r9f25f22ef6cd3566f8f7fbbc5c037a69e7f9411b --- firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision a52e41cc2219362d433149ca034908c8763d8378) +++ firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision 9f25f22ef6cd3566f8f7fbbc5c037a69e7f9411b) @@ -15,6 +15,7 @@ **************************************************************************/ #include "FPGA.h" +#include "Heaters.h" #include "OperationModes.h" #include "ROPump.h" #include "TaskGeneral.h" @@ -71,13 +72,16 @@ // re-initialize each time we transition to re-circulate mode initRecirculateMode(); - // TODO - set initial actuator states + // set initial actuator states setValveState( VPI, VALVE_STATE_OPEN ); setValveState( VRC, VALVE_STATE_RECIRC_C_TO_NC ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); + setROPumpTargetPressure( TARGET_RO_PRESSURE_PSI, PUMP_CONTROL_MODE_CLOSED_LOOP ); + signalDrainPumpHardStop(); + startPrimaryHeater(); // UV on - // Primary heater on + // conc. pumps off } /*********************************************************************//** @@ -94,7 +98,6 @@ switch ( recircState ) { case DG_RECIRCULATE_MODE_STATE_START: - setROPumpTargetPressure( TARGET_RO_PRESSURE_PSI, PUMP_CONTROL_MODE_CLOSED_LOOP ); recircState = DG_RECIRCULATE_MODE_STATE_FLUSH_LINES; break; @@ -134,6 +137,7 @@ F32 waterFlowRate = getMeasuredROFlowRate(); F32 waterVolume = ( ( waterFlowRate / SEC_PER_MIN ) / ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); + // integrate volume of water moved through line flushLinesVolume += waterVolume; // when enough water volume has flowed to flush the lines, transition to re-circ state