Index: firmware/App/Modes/ModeWaterPreGen.c =================================================================== diff -u -r28b6e281605c1a944c982d0ec7dcdb6f28aac82b -r286fbceae8be1276780690fe4b3010c8b2270239 --- firmware/App/Modes/ModeWaterPreGen.c (.../ModeWaterPreGen.c) (revision 28b6e281605c1a944c982d0ec7dcdb6f28aac82b) +++ firmware/App/Modes/ModeWaterPreGen.c (.../ModeWaterPreGen.c) (revision 286fbceae8be1276780690fe4b3010c8b2270239) @@ -83,14 +83,13 @@ /*********************************************************************//** * @brief * The execPreGenWMode function executes the pre gen water mode state machine. - * @details \b Inputs: none + * @details \b Inputs: preGenWState * @details \b Outputs: Pre Gen water mode state machine executed * @details \b Alarm: ALARM_ID_RO_SOFTWARE_FAULT when wrong pre gen water state invoked. * @return current state. *************************************************************************/ U32 execPreGenWMode( void ) { - // execute current gen water state switch ( preGenWState ) { @@ -105,7 +104,6 @@ default: SET_ALARM_WITH_2_U32_DATA( ALARM_ID_RO_SOFTWARE_FAULT, SW_FAULT_ID_RO_INVALID_PGEN_STATE, preGenWState ) break; - } //Publish pre Gen water mode data publishPreGenWModeData(); @@ -117,7 +115,7 @@ * @brief * The setModePreGenWTransition function sets the actuators and variables * for the state transition in pre generate water mode. - * @details Inputs: Valve states, Pump speed + * @details Inputs: none * @details Outputs: Actuate valves, pumps as desired. * @param state pre gen water state enum * @return none @@ -128,11 +126,11 @@ switch( state ) { case RO_PRE_GENW_STATE_START: - // Do nothing + // TODO: handler function of state start break; case RO_PRE_GENW_STATE_COMPLETE: - // Do nothing + // TODO: handler function of state complete break; default: @@ -149,7 +147,8 @@ *************************************************************************/ static RO_PRE_GENW_MODE_STATE_T handlePreGenWStartState( void ) { - RO_GENW_MODE_STATE_T state = RO_PRE_GENW_STATE_COMPLETE; + RO_PRE_GENW_MODE_STATE_T state = RO_PRE_GENW_STATE_COMPLETE; + setModePreGenWTransition( RO_PRE_GENW_STATE_COMPLETE ); return state; @@ -158,7 +157,7 @@ /*********************************************************************//** * @brief * The handlePreGenWCompleteState handles the complete state ofpre gen water. - * @details \b Inputs: none + * @details \b Inputs: pendingStartGenRequest * @details \b Outputs: none * @return the next state of pre gen water mode *************************************************************************/ @@ -180,8 +179,8 @@ * The getCurrentPreGenWState function returns the current state of the * pre gen water mode. * @details \b Inputs: preGenWState - * @details \b Outputs: preGenWState - * @return the current state of gen water mode + * @details \b Outputs: none + * @return the current state of pre gen water mode *************************************************************************/ RO_PRE_GENW_MODE_STATE_T getCurrentPreGenWState( void ) { @@ -207,8 +206,8 @@ * The publishPreGenWModeData function broadcasts the pre generate water * mode data at defined interval. * @details \b Inputs: genDialysateDataPublicationTimerCounter - * @details \b Outputs: DD generate water data broadcast message sent - * @details \b Message \Sent: MSG_ID_RO_GEN_WATER_MODE_DATA to publish the + * @details \b Outputs: preGenWState, preGenWDataPublicationTimerCounter + * @details \b Message \b Sent: MSG_ID_RO_GEN_WATER_MODE_DATA to publish the * generate water mode data. * @return none *************************************************************************/ @@ -218,7 +217,7 @@ { PRE_GENW_MODE_DATA_T data; - data.preGenWExecState = (U32)getCurrentPreGenWState(); + data.preGenWExecState = (U32)getCurrentPreGenWState(); broadcastData( MSG_ID_RO_PRE_GEN_WATER_MODE_DATA, COMM_BUFFER_OUT_CAN_RO_BROADCAST, (U08*)&data, sizeof( PRE_GENW_MODE_DATA_T ) ); @@ -229,8 +228,8 @@ /*********************************************************************//** * @brief * The requestPreGenStart function handles an DD request to start (go to gen permeate mode). - * @details \b Inputs: standbyState - * @details \b Outputs: pendingStartRORequest + * @details \b Inputs: preGenWState + * @details \b Outputs: pendingStartGenRequest * @return TRUE if request accepted, FALSE if not. *************************************************************************/ BOOL requestGenWaterStart( void )