Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rab447ebbc380f4c7abc2ae283042a5d0c9e1b9cb -rebbb1f85550a1f9b8f946655f7b2b63f76fbf67d --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision ab447ebbc380f4c7abc2ae283042a5d0c9e1b9cb) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision ebbb1f85550a1f9b8f946655f7b2b63f76fbf67d) @@ -26,7 +26,6 @@ #include "FPGA.h" #include "Heaters.h" #include "LoadCell.h" -#include "MessagePayloads.h" #include "ModeStandby.h" #include "ModeRecirculate.h" #include "MsgQueues.h" @@ -42,7 +41,6 @@ #include "TemperatureSensors.h" #include "Thermistors.h" #include "Utilities.h" -#include "Utilities.h" #include "Valves.h" #include "WatchdogMgmt.h" #include "UVReactors.h" @@ -448,31 +446,24 @@ /*********************************************************************//** * @brief * The broadcastHeatersData function sends out DG heaters data - * @details Inputs: heaters data - * @details Outputs: heatears data msg constructed and queued - * @param mainPrimaryDC main primary heater duty cycle - * @param smallPrimaryDC small primary heater duty cycle - * @param trimmerDC trimmer heater duty cycle + * @details Inputs: none + * @details Outputs: heaters data msg constructed and queued + * @param heatersData which is the heaters data structure pointer * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL broadcastHeatersData ( U32 mainPrimaryDC, U32 smallPrimaryDC, U32 trimmerDC ) +BOOL broadcastHeatersData ( HEATERS_DATA_T *heatersData ) { BOOL result; MESSAGE_T msg; U08 *payloadPtr = msg.payload; - HEATERS_DATA_T payload; - + // create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_HEATERS_DATA; msg.hdr.payloadLen = sizeof( HEATERS_DATA_T ); - payload.mainPrimayHeaterDC = mainPrimaryDC; - payload.smallPrimaryHeaterDC = smallPrimaryDC; - payload.trimmerHeaterDC = trimmerDC; + memcpy( payloadPtr, heatersData, sizeof( HEATERS_DATA_T ) ); - memcpy( payloadPtr, &payload, sizeof( HEATERS_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 ); @@ -903,6 +894,34 @@ /*********************************************************************//** * @brief + * The broadcastHeatDisinfectData function sends out the heat disinfect + * mode data. + * @details Inputs: none + * @details Outputs: heat disinfect data msg constructed and queued + * @param heatDisinfectData which is heat disinfect msg constructed and queued + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL broadcastHeatDisinfectData( MODE_HEAT_DISINFECT_DATA_T *heatDisinfectData ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_HEAT_DISINFECT_DATA; + msg.hdr.payloadLen = sizeof( MODE_HEAT_DISINFECT_DATA_T ); + + memcpy( payloadPtr, heatDisinfectData, sizeof( MODE_HEAT_DISINFECT_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 broadcastFilterFlushData function sends out the filter flush progress data. * @details Inputs: none * @details Outputs: filter flush data msg constructed and queued @@ -2703,7 +2722,7 @@ /*********************************************************************//** * @brief * The handleROPumpTargetPressureOverride function handles a request -* to override the target RO pump pressure. +* to override the RO pump target pressure. * @details Inputs: none * @details Outputs: message handled * @param message a pointer to the message to handle @@ -2728,6 +2747,40 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } +/************************************************************************* + * @brief + * The handleStartStopDGHeatDisinfect function handles a request start or + * stop DG heat disifect cycle. + * @details Inputs: none + * @details Outputs: message handled + * @param message: a pointer to the message to handle + * @return result + *************************************************************************/ +BOOL handleStartStopDGHeatDisinfect( MESSAGE_T *message ) +{ + BOOL status = FALSE; + + if ( message->hdr.payloadLen == sizeof(U32) ) + { + BOOL startingDGHeatDisinfect; + + memcpy( &startingDGHeatDisinfect, message->payload, sizeof(U32) ); + + if ( TRUE == startingDGHeatDisinfect ) + { + status = startDGHeatDisinfect(); + } + else + { + status = stopDGHeatDisinfect(); + } + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DG_2_HD, status ); + + return status; +} + /*********************************************************************//** * @brief * The handleSetDGCalibrationRecord function handles a request to set the DG