Skip to content

Seems like there is a problen with createPacket function. #10

Description

@jopandla

You test throttle for beeing command after bit shifting, effectively multiplying it by 2.

static inline uint16_t createPacket(uint16_t throttle) {
  uint8_t csum = 0;
  throttle <<= 1;
  // Indicate as command if less than 48
  if (throttle < 48 && throttle > 0)
    throttle |= 1;
  uint16_t csum_data = throttle;
...}

You should have tested for 48*2.
if (throttle < 48*2 && throttle > 0)
Or am I wrong?

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