Line 380 in DCC_Decoder.cpp
speedBits = ((speedBits << 1 ) & (cBit ? 1 : 0)) - 3; // speedBits = 1..28
Should use a bitwise OR operator rather than and AND operator. The objective is to add the cBit as the LSB value.
speedBits = ((speedBits << 1 ) | (cBit ? 1 : 0)) - 3; // speedBits = 1..28
Line 380 in DCC_Decoder.cpp
speedBits = ((speedBits << 1 ) & (cBit ? 1 : 0)) - 3; // speedBits = 1..28Should use a bitwise OR operator rather than and AND operator. The objective is to add the cBit as the LSB value.
speedBits = ((speedBits << 1 ) | (cBit ? 1 : 0)) - 3; // speedBits = 1..28