Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r98eaa905f2487013d5e9af76bf064f872332c2fe -r5d8530d242d8065178eab9e3e5d8e4561b790e01 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 98eaa905f2487013d5e9af76bf064f872332c2fe) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 5d8530d242d8065178eab9e3e5d8e4561b790e01) @@ -27,6 +27,7 @@ #include "Heaters.h" #include "LoadCell.h" #include "MessagePayloads.h" +#include "ModeFlush.h" #include "ModeStandby.h" #include "ModeRecirculate.h" #include "MsgQueues.h" @@ -911,7 +912,33 @@ return result; } +/*********************************************************************//** + * @brief + * The broadcastFlushData function sends out the flush mode data. + * @details Inputs: none + * @details Outputs: flush data msg constructed and queued + * @param flushData which is flush msg constructed and queued + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL broadcastFlushData( MODE_FLUSH_DATA_T *flushData ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_FLUSH_DATA; + msg.hdr.payloadLen = sizeof( MODE_FLUSH_DATA_T ); + + memcpy( payloadPtr, flushData, sizeof( MODE_FLUSH_DATA_T ) ); + + // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_DG_BROADCAST, ACK_NOT_REQUIRED ); + + return result; +} + /*********************************************************************//** * @brief * The sendCommandResponseMsg function constructs a command response to HD @@ -2511,7 +2538,15 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } -//*******************************************************************/ +/*********************************************************************//** +* @brief +* The handleROPumpTargetPressureOverride function handles a request +* to override the RO pump target pressure. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ void handleROPumpTargetPressureOverride( MESSAGE_T *message ) { BOOL result = FALSE; @@ -2531,4 +2566,39 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } +/*********************************************************************//** +* @brief +* The handleStartStopDGFlush function handles a request to override start +* or stop DG flush mode. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ +BOOL handleStartStopDGFlush( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + if ( message->hdr.payloadLen == sizeof(U32) ) + { + BOOL startingDGFlush; + + memcpy( &startingDGFlush, message->payload, sizeof(U32) ); + + if ( TRUE == startingDGFlush ) + { + startDGFlush(); + result = TRUE; + } + else + { + stopDGFlush(); + result = TRUE; + } + } + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DG_2_HD, result ); + + return result; +} + /**@}*/