Skip to content

28 bit speed control has incorrect cBit manipulation #15

Description

@swtya

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions