Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -ra7bf3ca23ea37a61000379facae628a31b3ecc59 -rf308cc4c35eab630ebbbde405cfe47d049afeafb --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision a7bf3ca23ea37a61000379facae628a31b3ecc59) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision f308cc4c35eab630ebbbde405cfe47d049afeafb) @@ -7,21 +7,24 @@ * * @file ModeFill.c * -* @author (last) Sean Nash -* @date (last) 02-Jul-2020 +* @author (last) Quang Nguyen +* @date (last) 13-Aug-2020 * * @author (original) Leonardo Baloa * @date (original) 19-Nov-2019 * ***************************************************************************/ +#include "ConductivitySensors.h" #include "FPGA.h" #include "LoadCell.h" +#include "ModeFill.h" #include "OperationModes.h" +#include "Pressures.h" #include "Reservoirs.h" #include "Timers.h" #include "Valves.h" -#include "ModeFill.h" +#include "TemperatureSensors.h" /** * @addtogroup DGFillMode @@ -85,6 +88,11 @@ *************************************************************************/ U32 execFillMode( void ) { + // check inlet water conductivity, temperature, and pressure + checkInletWaterConductivity( fillState ); + checkInletWaterTemperature(); + checkInletPressure(); + // execute current Fill state switch ( fillState ) { @@ -101,7 +109,7 @@ break; default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, 0, fillState ) // TODO - add s/w fault enum to 1st data param + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, 0, fillState ) // TODO - add s/w fault enum to 1st data param fillState = DG_FILL_MODE_STATE_START; break; } @@ -116,7 +124,6 @@ * @details * Inputs : none * Outputs : - * @param none * @return the next state *************************************************************************/ static DG_FILL_MODE_STATE_T handleDialysateProductionState( void ) @@ -140,7 +147,6 @@ * @details * Inputs : none * Outputs : - * @param none * @return the next state *************************************************************************/ static DG_FILL_MODE_STATE_T handleDeliverDialysateState( void ) @@ -155,13 +161,8 @@ result = DG_FILL_MODE_STATE_DIALYSATE_PRODUCTION; } - // determine which load cell to use for fill volume - we want weight of inactive reservoir -#ifndef BETA_V1_BUILD if ( RESERVOIR_1 == getActiveReservoir() ) -#else - if ( RESERVOIR_2 == getActiveReservoir() ) -#endif { fillWeightLoadCell = LOAD_CELL_B1; }