Index: firmware/App/Modes/ModeFlush.c =================================================================== diff -u -r63e6ce4cca0236d9886c73979bd183a6ec7e6da3 -r24fd1893101af40cc6736aacaa20382875c80bf1 --- firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision 63e6ce4cca0236d9886c73979bd183a6ec7e6da3) +++ firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) @@ -15,7 +15,6 @@ * ***************************************************************************/ -#include "ConductivitySensors.h" #include "DrainPump.h" #include "Heaters.h" #include "LoadCell.h" @@ -26,7 +25,6 @@ #include "ROPump.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" -#include "TemperatureSensors.h" #include "Timers.h" #include "UVReactors.h" #include "Valves.h" @@ -50,8 +48,6 @@ // Flush drain path state defines #define FLUSH_DRAIN_WAIT_TIME_MS ( 1 * 60 * MS_PER_SECOND ) ///< Flush Drain path wait time in milliseconds. TODo original time is 2 minutes #define MIN_INLET_TEMPERATURE_C 15.0 ///< Minimum water inlet temperature in C. TODO original temperature was 25 C -#define MIN_INLET_CONDUCTIVITY_US_PER_CM 0.0 ///< Minimum water inlet conductivity in uS/cm -#define MAX_INLET_CONDUCTIVITY_US_PER_CM 2000.0 ///< Maximum water inlet conductivity in us/cm // Flush dialysate state defines #define FLUSH_DIALYSATE_WAIT_TIME_MS ( 0.5 * 60 * MS_PER_SECOND ) ///< Flush dialysate wait time in milliseconds. @@ -117,15 +113,15 @@ void initFlushMode( void ) { // Initialize the variables - flushState = DG_FLUSH_STATE_START; - prevFlushState = DG_FLUSH_STATE_START; - rsrvrFillStableTimeCounter = 0; - overallFlushElapsedTimeStart = 0; - isThisInitialDrain = TRUE; - dataPublishCounter = 0; - rsrvr1Status = NUM_OF_DG_RESERVOIR_STATUS; - rsrvr2Status = NUM_OF_DG_RESERVOIR_STATUS; - hasWaterCancellationBeenSet = FALSE; + flushState = DG_FLUSH_STATE_START; + prevFlushState = DG_FLUSH_STATE_START; + rsrvrFillStableTimeCounter = 0; + overallFlushElapsedTimeStart = 0; + isThisInitialDrain = TRUE; + dataPublishCounter = 0; + rsrvr1Status = NUM_OF_DG_RESERVOIR_STATUS; + rsrvr2Status = NUM_OF_DG_RESERVOIR_STATUS; + hasWaterCancellationBeenSet = FALSE; } /*********************************************************************//** @@ -235,10 +231,23 @@ * @details Outputs: none * @return none *************************************************************************/ -void stopDGFlush( void ) +BOOL stopDGFlush( void ) { - // Transition to mode standby - requestNewOperationMode( DG_MODE_STAN ); + BOOL status = FALSE; + + // Check if the current operation mode is heat disinfect + if ( DG_MODE_FLUS == getCurrentOperationMode() ) + { + // Reset all the actuators + resetActuators(); + + // Transition to mode standby + requestNewOperationMode( DG_MODE_STAN ); + + status = TRUE; + } + + return status; } // ********** private functions ********** @@ -259,9 +268,6 @@ // Start overall flush timer overallFlushElapsedTimeStart = getMSTimerCount(); - // Reset the load cells lowest weight prior to starting the run - resetReservoirsLowestWeight(); - // Close VPi to prevent wasting water setValveState( VPI, VALVE_STATE_CLOSED );