Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r28b6e281605c1a944c982d0ec7dcdb6f28aac82b -r286fbceae8be1276780690fe4b3010c8b2270239 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 28b6e281605c1a944c982d0ec7dcdb6f28aac82b) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 286fbceae8be1276780690fe4b3010c8b2270239) @@ -46,7 +46,7 @@ void initStandbyMode( void ) { standbyState = RO_STANDBY_MODE_STATE_IDLE; - pendingStartPreGenRequest = FALSE; + pendingStartPreGenRequest = FALSE; } /*********************************************************************//** 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 ) Index: firmware/App/Modes/ModeWaterPreGen.h =================================================================== diff -u -r28b6e281605c1a944c982d0ec7dcdb6f28aac82b -r286fbceae8be1276780690fe4b3010c8b2270239 --- firmware/App/Modes/ModeWaterPreGen.h (.../ModeWaterPreGen.h) (revision 28b6e281605c1a944c982d0ec7dcdb6f28aac82b) +++ firmware/App/Modes/ModeWaterPreGen.h (.../ModeWaterPreGen.h) (revision 286fbceae8be1276780690fe4b3010c8b2270239) @@ -46,7 +46,8 @@ RO_PRE_GENW_MODE_STATE_T getCurrentPreGenWState( void ); // Get the current state of the pre gen water mode +BOOL testPreGenWaterDataPublishIntervalOverride( MESSAGE_T *message ); + /**@}*/ - #endif Index: firmware/App/Services/DDInterface.c =================================================================== diff -u -r28b6e281605c1a944c982d0ec7dcdb6f28aac82b -r286fbceae8be1276780690fe4b3010c8b2270239 --- firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision 28b6e281605c1a944c982d0ec7dcdb6f28aac82b) +++ firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision 286fbceae8be1276780690fe4b3010c8b2270239) @@ -144,7 +144,6 @@ if ( message->hdr.payloadLen == sizeof( RO_WATER_REQ_PAYLOAD_T ) ) { RO_WATER_REQ_PAYLOAD_T cmd; - memcpy( &cmd, message->payload, sizeof( RO_WATER_REQ_PAYLOAD_T ) ); switch ( cmd.cmdID ) @@ -159,8 +158,6 @@ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_RO_SOFTWARE_FAULT, SW_FAULT_ID_RO_INVALID_RO_CMD, cmd.cmdID ) break; } - - } return result; Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r28b6e281605c1a944c982d0ec7dcdb6f28aac82b -r286fbceae8be1276780690fe4b3010c8b2270239 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 28b6e281605c1a944c982d0ec7dcdb6f28aac82b) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 286fbceae8be1276780690fe4b3010c8b2270239) @@ -9,6 +9,7 @@ #include "Level.h" #include "Messaging.h" #include "ModeWaterGen.h" +#include "ModeWaterPreGen.h" #include "OperationModes.h" #include "PAL.h" #include "Pressure.h" @@ -87,7 +88,8 @@ MSG_ID_RO_CONDUCTIVITY_READ_COUNT_OVERRIDE_REQUEST, MSG_ID_RO_CONDUCTIVITY_ERROR_COUNT_OVERRIDE_REQUEST, MSG_ID_RO_TEMPERATURE_OVERRIDE_REQUEST, - MSG_ID_DD_RO_START_STOP_CMD_REQUEST //30 + MSG_ID_DD_RO_START_STOP_CMD_REQUEST, //30 + MSG_ID_RO_PRE_GEN_PUBLISH_INTERVAL_OVERRIDE_REQUEST }; /// Message handling function table @@ -121,7 +123,8 @@ &testConductivitySensorReadCounterOverride, &testConductivitySensorErrorCounterOverride, &testMeasuredTemperatureOverride, - &handleGenerateWaterRequestMsg //30 + &handleGenerateWaterRequestMsg, //30 + &testPreGenWaterDataPublishIntervalOverride }; #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLERS) / sizeof(MsgFuncPtr))