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 ); Index: firmware/App/Modes/ModeFlush.h =================================================================== diff -u -r5d8530d242d8065178eab9e3e5d8e4561b790e01 -r24fd1893101af40cc6736aacaa20382875c80bf1 --- firmware/App/Modes/ModeFlush.h (.../ModeFlush.h) (revision 5d8530d242d8065178eab9e3e5d8e4561b790e01) +++ firmware/App/Modes/ModeFlush.h (.../ModeFlush.h) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) @@ -47,7 +47,7 @@ DG_FLUSH_STATE_T getCurrentFlushState( void ); // get the current state of the flush mode. -void stopDGFlush( void ); +BOOL stopDGFlush( void ); /**@}*/ Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -r28b5f2e7f757647145a82a39aca0a5f3652c68a1 -r24fd1893101af40cc6736aacaa20382875c80bf1 --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 28b5f2e7f757647145a82a39aca0a5f3652c68a1) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) @@ -399,9 +399,6 @@ // Set all the actuators to reset and de-energized state resetActuators(); - // Reset the load cells lowest weight prior to starting the run - resetReservoirsLowestWeight(); - F32 ppiPressure = getMeasuredDGPressure( PRESSURE_SENSOR_RO_PUMP_INLET ); F32 TDiTemp = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); //TODo change to TDi F32 TRoTemp = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r3eb7c2e62c727be195cd937d49957db9d4ba83b4 -r24fd1893101af40cc6736aacaa20382875c80bf1 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 3eb7c2e62c727be195cd937d49957db9d4ba83b4) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) @@ -369,8 +369,8 @@ BOOL result = FALSE; // If DG is in standby mode or in the solo mode and the standby mode is in Idle state, request DG flush - if ( ( DG_MODE_STAN == getCurrentOperationMode() || DG_MODE_SOLO == getCurrentOperationMode() ) && - DG_STANDBY_MODE_STATE_IDLE == standbyState ) + if ( ( DG_MODE_STAN == getCurrentOperationMode() && DG_STANDBY_MODE_STATE_IDLE == standbyState ) || + DG_MODE_SOLO == getCurrentOperationMode() ) { requestNewOperationMode( DG_MODE_FLUS ); Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r3eb7c2e62c727be195cd937d49957db9d4ba83b4 -r24fd1893101af40cc6736aacaa20382875c80bf1 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 3eb7c2e62c727be195cd937d49957db9d4ba83b4) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) @@ -361,20 +361,6 @@ /*********************************************************************//** * @brief - * The resetReservoirsLowestWeight function resets the lowest load cell - * weight of the reservoirs. - * @details Inputs: reservoirLowestWeight - * @details Outputs: reservoirLowestWeight - * @return none - *************************************************************************/ -void resetReservoirsLowestWeight( void ) -{ - reservoirLowestWeight[ DG_RESERVOIR_1 ] = MAX_RESERVOIR_WEIGHT; - reservoirLowestWeight[ DG_RESERVOIR_2 ] = MAX_RESERVOIR_WEIGHT; -} - -/*********************************************************************//** - * @brief * The getInactiveReservoir function gets the inactive reservoir. * @details Inputs: activeReservoir * @details Outputs: none Index: firmware/App/Services/Reservoirs.h =================================================================== diff -u -r3eb7c2e62c727be195cd937d49957db9d4ba83b4 -r24fd1893101af40cc6736aacaa20382875c80bf1 --- firmware/App/Services/Reservoirs.h (.../Reservoirs.h) (revision 3eb7c2e62c727be195cd937d49957db9d4ba83b4) +++ firmware/App/Services/Reservoirs.h (.../Reservoirs.h) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) @@ -79,8 +79,6 @@ void tareReservoir( void ); -void resetReservoirsLowestWeight( void ); - DG_RESERVOIR_ID_T getInactiveReservoir( void ); F32 getReservoirWeight( DG_RESERVOIR_ID_T reservoirId ); Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r3eb7c2e62c727be195cd937d49957db9d4ba83b4 -r24fd1893101af40cc6736aacaa20382875c80bf1 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 3eb7c2e62c727be195cd937d49957db9d4ba83b4) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) @@ -2861,13 +2861,11 @@ if ( TRUE == startingDGFlush ) { - startDGFlush(); - result = TRUE; + result = startDGFlush(); } else { - stopDGFlush(); - result = TRUE; + result = stopDGFlush(); } }