Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -racebbc372d11f4f46a64eefc36ae784cbd08880d -rab304e2ca6e3e40ed8cb12650e9855ae0b9649d8 --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision acebbc372d11f4f46a64eefc36ae784cbd08880d) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision ab304e2ca6e3e40ed8cb12650e9855ae0b9649d8) @@ -7,8 +7,8 @@ * * @file ModeHeatDisinfect.c * -* @author (last) Sean Nash -* @date (last) 26-May-2020 +* @author (last) Quang Nguyen +* @date (last) 01-Sep-2020 * * @author (original) Sean * @date (original) 20-Apr-2020 @@ -27,6 +27,7 @@ #include "UVReactors.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" +#include "Pressures.h" // TODO control composition pumps // TODO add code NVDataMgmt regarding heat disinfection @@ -66,7 +67,7 @@ #define RO_PUMP_TARGET_FLOW_RATE_LPM 0.9 ///< RO pump target flow rate #define FULL_RESERVOIRS_WEIGHT_GRAMS 500U ///< The weight of a full reservoir //TODO Change this value to full value -#define EMPTY_RESERVOIRS_WEIGHT_GRAMS 200U ///< The weight of an empty reservoir //TODO Change this value to full value +#define EMPTY_RESERVOIRS_WEIGHT_GRAMS 300U ///< The weight of an empty reservoir //TODO Change this value to full value // ********** private data ********** @@ -143,7 +144,7 @@ /*********************************************************************//** * @brief - * The initHeatDisinfectMode function initializes the heat disinfect Mode module. + * The initHeatDisinfectMode function initializes the heat disinfect mode module. * @details * Inputs: none * Outputs: none @@ -183,6 +184,9 @@ *************************************************************************/ U32 execHeatDisinfectMode( void ) { + //checkInletPressureFault(); + + // execute current heat disinfect state switch ( heatDisinfectState ) { case DG_HEAT_DISINFECT_STATE_START: @@ -234,7 +238,7 @@ /*********************************************************************//** * @brief - * The getCurrentHeatDisinfectState function returns the current state of the \n + * The getCurrentHeatDisinfectState function returns the current state of the * heat disinfect mode. * @details * Inputs: heatState @@ -358,8 +362,8 @@ { DG_HEAT_DISINFECT_STATE_T state = DG_HEAT_DISINFECT_STATE_HEAT_WATER; - F32 TPi = getTemperatureValue ( TEMPSENSORS_OUTLET_PRIMARY_HEATER_TEMP_SENSOR ); - F32 TDi = getTemperatureValue ( TEMPSENSORS_INLET_DIALYSATE_TEMP_SENSOR ); + F32 TPi = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER ); + F32 TDi = getTemperatureValue( TEMPSENSORS_INLET_DIALYSATE ); if ( fabs(TPi - HEAT_DISINFECT_TARGET_TEMPERATURE) <= MAX_TEMPERATURE_DEVIATION_FROM_TARGET && fabs(TDi - HEAT_DISINFECT_TARGET_TEMPERATURE) <= MAX_TEMPERATURE_DEVIATION_FROM_TARGET ) @@ -630,7 +634,7 @@ /*********************************************************************//** * @brief - * The handleHeatDisinfectOffState function handles internal heat disinfec \n + * The handleHeatDisinfectOffState function handles internal heat disinfect \n * off state * @details * Inputs: heatDisinfectState, stateTimer @@ -896,8 +900,8 @@ static BOOL isTemperatureInRange( void ) { BOOL result = FALSE; - F32 TPi = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER_TEMP_SENSOR ); - F32 TDi = getTemperatureValue( TEMPSENSORS_INLET_DIALYSATE_TEMP_SENSOR ); + F32 TPi = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER ); + F32 TDi = getTemperatureValue( TEMPSENSORS_INLET_DIALYSATE ); if ( fabs(TPi - HEAT_DISINFECT_TARGET_TEMPERATURE) <= MAX_TEMPERATURE_DEVIATION_FROM_TARGET && fabs(TDi - HEAT_DISINFECT_TARGET_TEMPERATURE) <= MAX_TEMPERATURE_DEVIATION_FROM_TARGET )