Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r47a7da55aea88cd7a2b06870226122d0cc8be540 -ra60ec05d359c0d3f014015e9080b6dbcef0fea28 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 47a7da55aea88cd7a2b06870226122d0cc8be540) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision a60ec05d359c0d3f014015e9080b6dbcef0fea28) @@ -26,10 +26,11 @@ #include "Dialysis.h" #include "ModeTreatment.h" #include "PresOccl.h" -#include "WatchdogMgmt.h" +#include "SafetyShutdown.h" +#include "SystemComm.h" #include "SystemCommMessages.h" #include "Utilities.h" -#include "SystemComm.h" +#include "WatchdogMgmt.h" #include "RTC.h" // ********** private definitions ********** @@ -1159,6 +1160,27 @@ return result; } +#ifdef EMC_TEST_BUILD +BOOL broadcastCANErrorCount( U32 count ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_CAN_ERROR_COUNT; + msg.hdr.payloadLen = sizeof( U32 ); + + memcpy( payloadPtr, &count, sizeof( U32 ) ); + + // 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_HD_BROADCAST, ACK_NOT_REQUIRED ); + + return result; +} +#endif + // *********************************************************************** // **************** Message Handling Helper Functions ******************** // ***********************************************************************