Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r7fa65a3aae9c4ef70a6e53f3e3bb20f0425bd681 -ra60ec05d359c0d3f014015e9080b6dbcef0fea28 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 7fa65a3aae9c4ef70a6e53f3e3bb20f0425bd681) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision a60ec05d359c0d3f014015e9080b6dbcef0fea28) @@ -123,6 +123,10 @@ static U32 badCRCListIdx = 0; // where next bad message CRC time stamp will go in list static U32 badCRCListCount = 0; // # of bad CRCs in the list +#ifdef EMC_TEST_BUILD +static U32 badCANCount; // test code in support of EMC testing +#endif + // ********** private function prototypes ********** #ifdef DEBUG_ENABLED @@ -726,6 +730,10 @@ else if ( -1 == msgSize ) // candidate message with bad CRC found? { badCRCDetected = TRUE; +#ifdef EMC_TEST_BUILD + badCANCount++; + broadcastCANErrorCount( badCANCount ); +#endif getFromCommBuffer( MSG_IN_BUFFERS[ i ], data, 1 ); // consume sync byte so we can re-sync messagesInBuffer = TRUE; // keep processing this buffer } // looks like there is a complete message in the comm buffer @@ -864,6 +872,10 @@ } else // CRC failed { +#ifdef EMC_TEST_BUILD + badCANCount++; + broadcastCANErrorCount( badCANCount ); +#endif checkTooManyBadMsgCRCs(); } }