Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r968f9908941a8f8ceeacdb6aa40655abf54c1ef4 -r7c8ec681f8c5dc44674893b5c3924a6203f2c8d0 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 968f9908941a8f8ceeacdb6aa40655abf54c1ef4) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 7c8ec681f8c5dc44674893b5c3924a6203f2c8d0) @@ -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,16 +730,11 @@ 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 -//#ifdef DEBUG_ENABLED -//{ -// // TODO - temporary debug code - remove later -// char debugStr[ 20 ]; -// -// sprintf( debugStr, "%02X", (S32)data[0] ); -// sendDebugData( (U08*)debugStr, strlen(debugStr) ); -//} -//#endif messagesInBuffer = TRUE; // keep processing this buffer } // looks like there is a complete message in the comm buffer } // enough data left in comm buffer to possibly be a complete message @@ -770,27 +769,11 @@ peekFromCommBuffer( buffer, &data, 1 ); if ( MESSAGE_SYNC_BYTE == data ) { -//#ifdef DEBUG_ENABLED -//{ -// // TODO - temporary debug code - remove later -// char debugStr[ 3 ] = "\n"; -// sendDebugData( (U08*)debugStr, strlen(debugStr) ); -//} -//#endif break; // we found a sync - we're done } else // not a sync byte, so consume it { getFromCommBuffer( buffer, &data, 1 ); -//#ifdef DEBUG_ENABLED -//{ -// // TODO - temporary debug code - remove later -// char debugStr[ 20 ]; -// -// sprintf( debugStr, "%02X ", (U32)data ); -// sendDebugData( (U08*)debugStr, strlen(debugStr) ); -//} -//#endif numOfBytesInBuffer = numberOfBytesInCommBuffer( buffer ); } } @@ -889,6 +872,10 @@ } else // CRC failed { +#ifdef EMC_TEST_BUILD + badCANCount++; + broadcastCANErrorCount( badCANCount ); +#endif checkTooManyBadMsgCRCs(); } } @@ -1119,6 +1106,10 @@ handleFWVersionRequest( message ); break; + case MSG_ID_DG_TEMPERATURE_DATA: + handleDGTemperatureData( message ); + break; + case MSG_ID_RO_PUMP_DATA: handleROPumpData( message ); break; @@ -1301,6 +1292,10 @@ handleTestDialOutLoadCellWeightOverrideRequest( message ); break; + case MSG_ID_HD_SAFETY_SHUTDOWN_OVERRIDE: + handleTestHDSafetyShutdownOverrideRequest( message ); + break; + default: // TODO - unrecognized message ID received - ignore break;