Index: firmware/App/Modes/ModeDrain.c =================================================================== diff -u -rcea079b61dbd17b2ddaec99b1124248147d14e72 -r54e58f64179ea382d2e2c403c8c3b9a15a612636 --- firmware/App/Modes/ModeDrain.c (.../ModeDrain.c) (revision cea079b61dbd17b2ddaec99b1124248147d14e72) +++ firmware/App/Modes/ModeDrain.c (.../ModeDrain.c) (revision 54e58f64179ea382d2e2c403c8c3b9a15a612636) @@ -23,6 +23,7 @@ #include "Pressures.h" #include "Reservoirs.h" #include "ROPump.h" +#include "SystemComm.h" #include "TaskGeneral.h" #include "TemperatureSensors.h" #include "Valves.h" @@ -80,7 +81,6 @@ // re-initialize each time we transition to drain mode initDrainMode(); -#ifndef V_2_SYSTEM DG_RESERVOIR_ID_T inactiveReservoir = getInactiveReservoir(); if ( DG_RESERVOIR_1 == inactiveReservoir ) @@ -91,7 +91,6 @@ { setValveStateDelayed( VRD2, VALVE_STATE_OPEN, DELAY_RES_DRAIN_VALVE_MS ); } -#endif // set initial actuator states setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setDrainPumpTargetRPMDelayed( TARGET_DRAIN_PUMP_RPM, DELAY_DRAIN_PUMP_MS ); @@ -100,7 +99,7 @@ // because the initial guess in the heaters driver needs the target flow to calculate // the new PWMs for the main and small primary heaters setROPumpTargetFlowRate( TARGET_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); - startPrimaryHeater(); + startHeater( DG_PRIMARY_HEATER ); } /*********************************************************************//** @@ -158,12 +157,11 @@ DG_DRAIN_STATE_T result = DG_DRAIN_STATE_DRAIN; DG_RESERVOIR_ID_T inactiveReservoir = getInactiveReservoir(); - // 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 we have reached our target drain to volume (by weight) or cannot drain anymore, we are done draining - go back to generation idle mode if ( TRUE == hasTargetDrainVolumeBeenReached( inactiveReservoir, DRAIN_WEIGHT_UNCHANGE_TIMEOUT ) ) { setDrainPumpTargetRPM( 0 ); -#ifndef V_2_SYSTEM if ( DG_RESERVOIR_1 == inactiveReservoir ) { setValveState( VRD1, VALVE_STATE_CLOSED ); @@ -172,15 +170,14 @@ { setValveState( VRD2, VALVE_STATE_CLOSED ); } -#endif if ( TRUE == isReservoirTarePending() ) { // Tare reservoir load cells at empty if requested result = DG_DRAIN_STATE_TARE; } else { - requestNewOperationMode( DG_MODE_CIRC ); + requestNewOperationMode( DG_MODE_GENE ); } } @@ -204,12 +201,10 @@ { drainEmptyTareTimerCtr = 0; tareLoadCellsAtEmpty( inactiveReservoir ); - requestNewOperationMode( DG_MODE_CIRC ); + requestNewOperationMode( DG_MODE_GENE ); -#ifndef V_2_SYSTEM setValveState( VRD1, VALVE_STATE_CLOSED ); setValveState( VRD2, VALVE_STATE_CLOSED ); -#endif } return result;