Index: firmware/App/Modes/ModeRecirculate.c =================================================================== diff -u -r431de35ec5d48cbcd7f6fdf9b1586616d7ac3c05 -rf5b02f03b6695c0c76fd8a4d902a13114e1a8aca --- firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision 431de35ec5d48cbcd7f6fdf9b1586616d7ac3c05) +++ firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision f5b02f03b6695c0c76fd8a4d902a13114e1a8aca) @@ -34,14 +34,14 @@ // ********** private data ********** -static RECIRCULATE_MODE_STATE_T recircState; ///< Currently active re-circulation state. +static DG_RECIRCULATE_MODE_STATE_T recircState; ///< Currently active re-circulation state. static F32 flushLinesVolume = 0.0; ///< Volume of water pumped by RO pump during flush lines state. // ********** private function prototypes ********** -static RECIRCULATE_MODE_STATE_T handleFlushLinesState( void ); -static RECIRCULATE_MODE_STATE_T handleRecircWaterState( void ); -static RECIRCULATE_MODE_STATE_T handleRecircPauseState( void ); +static DG_RECIRCULATE_MODE_STATE_T handleFlushLinesState( void ); +static DG_RECIRCULATE_MODE_STATE_T handleRecircWaterState( void ); +static DG_RECIRCULATE_MODE_STATE_T handleRecircPauseState( void ); /*********************************************************************//** * @brief @@ -53,7 +53,7 @@ *************************************************************************/ void initRecirculateMode( void ) { - recircState = RECIRCULATE_MODE_STATE_START; + recircState = DG_RECIRCULATE_MODE_STATE_START; flushLinesVolume = 0.0; } @@ -86,35 +86,37 @@ * @details * Inputs : recircState * Outputs : recircState - * @return none + * @return current state *************************************************************************/ -void execRecirculateMode( void ) +U32 execRecirculateMode( void ) { // execute current re-circulate state switch ( recircState ) { - case RECIRCULATE_MODE_STATE_START: + case DG_RECIRCULATE_MODE_STATE_START: setROPumpTargetPressure( TARGET_RO_PRESSURE_PSI, PUMP_CONTROL_MODE_CLOSED_LOOP ); - recircState = RECIRCULATE_MODE_STATE_FLUSH_LINES; + recircState = DG_RECIRCULATE_MODE_STATE_FLUSH_LINES; break; - case RECIRCULATE_MODE_STATE_FLUSH_LINES: + case DG_RECIRCULATE_MODE_STATE_FLUSH_LINES: recircState = handleFlushLinesState(); break; - case RECIRCULATE_MODE_STATE_RECIRC_WATER: + case DG_RECIRCULATE_MODE_STATE_RECIRC_WATER: recircState = handleRecircWaterState(); break; - case RECIRCULATE_MODE_STATE_PAUSE: + case DG_RECIRCULATE_MODE_STATE_PAUSE: recircState = handleRecircPauseState(); break; default: SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, 0, recircState ) // TODO - add s/w fault enum to 1st data param - recircState = RECIRCULATE_MODE_STATE_START; + recircState = DG_RECIRCULATE_MODE_STATE_START; break; } + + return (U32)recircState; } /*********************************************************************//** @@ -126,9 +128,9 @@ * Outputs : * @return the next state *************************************************************************/ -static RECIRCULATE_MODE_STATE_T handleFlushLinesState( void ) +static DG_RECIRCULATE_MODE_STATE_T handleFlushLinesState( void ) { - RECIRCULATE_MODE_STATE_T result = RECIRCULATE_MODE_STATE_FLUSH_LINES; + DG_RECIRCULATE_MODE_STATE_T result = DG_RECIRCULATE_MODE_STATE_FLUSH_LINES; F32 waterFlowRate = getMeasuredROFlowRate(); F32 waterVolume = ( ( waterFlowRate / SEC_PER_MIN ) / ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); @@ -138,7 +140,7 @@ if ( flushLinesVolume >= FLUSH_LINES_VOLUME_L ) { // TODO - change VDr from drain to re-circulate - result = RECIRCULATE_MODE_STATE_RECIRC_WATER; + result = DG_RECIRCULATE_MODE_STATE_RECIRC_WATER; } return result; @@ -153,9 +155,9 @@ * Outputs : * @return the next state *************************************************************************/ -static RECIRCULATE_MODE_STATE_T handleRecircWaterState( void ) +static DG_RECIRCULATE_MODE_STATE_T handleRecircWaterState( void ) { - RECIRCULATE_MODE_STATE_T result = RECIRCULATE_MODE_STATE_RECIRC_WATER; + DG_RECIRCULATE_MODE_STATE_T result = DG_RECIRCULATE_MODE_STATE_RECIRC_WATER; return result; } @@ -169,9 +171,9 @@ * Outputs : * @return the next state *************************************************************************/ -static RECIRCULATE_MODE_STATE_T handleRecircPauseState( void ) +static DG_RECIRCULATE_MODE_STATE_T handleRecircPauseState( void ) { - RECIRCULATE_MODE_STATE_T result = RECIRCULATE_MODE_STATE_PAUSE; + DG_RECIRCULATE_MODE_STATE_T result = DG_RECIRCULATE_MODE_STATE_PAUSE; return result; } @@ -195,14 +197,14 @@ /*********************************************************************//** * @brief - * The getRecirculateModeState function returns the current state of the \n + * The getCurrentRecirculateState function returns the current state of the \n * re-circulate mode. * @details * Inputs : recircState * Outputs : none * @return the current state of re-circulate mode. *************************************************************************/ -RECIRCULATE_MODE_STATE_T getRecirculateModeState( void ) +DG_RECIRCULATE_MODE_STATE_T getCurrentRecirculateState( void ) { return recircState; }