* 'master' of https://github.com/mrrwa/NmraDcc:
  Update NmraDcc.cpp
  Update NmraDcc.cpp (#28)
This commit is contained in:
Alex Shepherd
2019-08-19 19:08:28 +12:00

View File

@@ -1101,7 +1101,8 @@ void execDccProcessor( DCC_MSG * pDccMsg )
{ {
resetServiceModeTimer( 1 ) ; resetServiceModeTimer( 1 ) ;
if( memcmp( pDccMsg, &DccProcState.LastMsg, sizeof( DCC_MSG ) ) ) //Only check the DCC Packet "Size" and "Data" fields and ignore the "PreambleBits" as they can be different to the previous packet
if(pDccMsg->Size != DccProcState.LastMsg.Size || memcmp( pDccMsg->Data, &DccProcState.LastMsg.Data, pDccMsg->Size ) != 0 )
{ {
DccProcState.DuplicateCount = 0 ; DccProcState.DuplicateCount = 0 ;
memcpy( &DccProcState.LastMsg, pDccMsg, sizeof( DCC_MSG ) ) ; memcpy( &DccProcState.LastMsg, pDccMsg, sizeof( DCC_MSG ) ) ;