Index: App/Services/SystemComm.c =================================================================== diff -u -r6c8c486d26306662402945537c5acaea2709d85b -r447eb904c9deb9536c04c9cc0e009a0b26b55573 --- App/Services/SystemComm.c (.../SystemComm.c) (revision 6c8c486d26306662402945537c5acaea2709d85b) +++ App/Services/SystemComm.c (.../SystemComm.c) (revision 447eb904c9deb9536c04c9cc0e009a0b26b55573) @@ -141,7 +141,7 @@ } // if UART transmitter is idle, start transmitting any pending packets -// if ( FALSE == isSCI1DMATransmitInProgress() ) + if ( FALSE == isSCI1DMATransmitInProgress() ) { transmitNextUARTPacket(); } @@ -278,7 +278,7 @@ pcDMARecvControlRecord.FRDOFFSET = 0; // not used pcDMARecvControlRecord.FRSOFFSET = 0; // not used - // initiate UART packet receiving readiness via DMA + // initiate PC packet receiving readiness via DMA dmaSetCtrlPacket( DMA_CH1, pcDMARecvControlRecord ); dmaSetChEnable( DMA_CH1, DMA_HW ); setSCI1DMAReceiveInterrupt(); @@ -554,11 +554,12 @@ U32 pos = i + 1; // skip past sync byte implemented U32 remSize = len - pos; - // if a minimum sized msg would fit in remaining + // if a minimum sized msg would fit in remaining, continue if ( remSize >= MESSAGE_OVERHEAD_SIZE ) { cargoSize = data[pos+sizeof(U16)]; msgSize = MESSAGE_OVERHEAD_SIZE + cargoSize; + // we now know the size of the message - we can now know if full message is contained in buffer if ( msgSize <= remSize ) { result = msgSize; // we found a complete message of this size @@ -646,6 +647,10 @@ { switch ( msgID ) { + case MSG_ID_HD_MESSAGE: + handleTestHDMessageRequest( message ); + break; + case MSG_ID_OFF_BUTTON_STATE_OVERRIDE: handleTestOffButtonStateOverrideRequest( message ); break;