Index: MessageSupport.c =================================================================== diff -u -r706d450e92a86b9751fccce9e71aa0080798ea01 -r343d278eb0278c79e00dee6151fb9ef21d2fda9c --- MessageSupport.c (.../MessageSupport.c) (revision 706d450e92a86b9751fccce9e71aa0080798ea01) +++ MessageSupport.c (.../MessageSupport.c) (revision 343d278eb0278c79e00dee6151fb9ef21d2fda9c) @@ -1,4 +1,5 @@ +#include "MessageSupport.h" #include "SystemCommMessages.h" #include "Utilities.h" @@ -12,9 +13,9 @@ /*********************************************************************//** * @brief - * The broadcastData function broadcasts data. + * The broadcastData function queues a broadcast message for transmission. * @details Inputs: none - * @details Outputs: load cell data msg constructed and queued + * @details Outputs: broadcast data msg constructed and queued * @param msgID message ID of the data is broadcast * @param buffer comm buffer ID * @param dataPtr pointer to the start of the buffer @@ -32,7 +33,10 @@ msg.hdr.msgID = msgID; msg.hdr.payloadLen = length; - memcpy( payloadPtr, dataPtr, length ); + if ( ( length > 0 ) && ( dataPtr != 0 ) ) + { + memcpy( payloadPtr, dataPtr, length ); + } // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer result = serializeMessage( msg, buffer, ACK_NOT_REQUIRED );