Index: firmware/App/Modes/ModeGenIdle.c =================================================================== diff -u -rf2a05f797ee73d2b3355a4e2bcdb76f9328dca8c -reeaab2a9a685fb18845888d91040d3aa01977f6d --- firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision f2a05f797ee73d2b3355a4e2bcdb76f9328dca8c) +++ firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision eeaab2a9a685fb18845888d91040d3aa01977f6d) @@ -8,8 +8,8 @@ * * @file ModeGenIdle.c * -* @author (last) Dara Navaei -* @date (last) 20-Apr-2023 +* @author (last) Michael Garthwaite +* @date (last) 16-May-2023 * * @author (original) Quang Nguyen * @date (original) 06-Aug-2021 @@ -104,7 +104,7 @@ { // Re-initialize each time we transition to generation idle mode initGenIdleMode(); - + setCurrentSubState( NO_SUB_STATE ); // Set initial actuator states setValveState( VSP, VALVE_STATE_CLOSED ); setValveState( VPI, VALVE_STATE_OPEN ); @@ -115,6 +115,9 @@ setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); + // Set back the conductivity of CD2 calibration table to the normal calibration table + setCondcutivitySensorCalTable( CONDUCTIVITYSENSORS_CD2_SENSOR, CAL_DATA_CD2_COND_SENSOR ); + signalDrainPumpHardStop(); requestConcentratePumpOff( CONCENTRATEPUMPS_CP1_ACID, NO_PARK_CONC_PUMPS ); requestConcentratePumpOff( CONCENTRATEPUMPS_CP2_BICARB, NO_PARK_CONC_PUMPS ); @@ -286,6 +289,7 @@ static DG_GEN_IDLE_MODE_STATE_T handleBadFillState( void ) { DG_GEN_IDLE_MODE_STATE_T result = DG_GEN_IDLE_MODE_STATE_HANDLE_BAD_FILL; + U32 priorSubState = badFillState; // Execute current bad fill state switch ( badFillState ) @@ -316,6 +320,10 @@ break; } + if ( priorSubState != badFillState ) + { + setCurrentSubState( badFillState ); + } return result; } @@ -404,7 +412,7 @@ * The handleRefillState function executes refill state of the handle bad * fill state machine. * @details Inputs: none - * @details Outputs: none + * @details Outputs: handleBadFillFlag * @param idleState reference variable for the next idle state * @return the next state *************************************************************************/