Fix Halsim DS Button Format (#1583)

This commit is contained in:
Jaci Brunning
2019-02-02 15:23:04 +08:00
committed by Peter Johnson
parent 1eb4c99d15
commit 404666b298
2 changed files with 16 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ void DSCommPacket::ReadJoystickTag(wpi::ArrayRef<uint8_t> dataInput,
int numBytes = (buttonCount + 7) / 8;
stick.buttons.buttons = 0;
for (int i = 0; i < numBytes; i++) {
stick.buttons.buttons |= dataInput[1 + i] << (8 * (i));
stick.buttons.buttons |= dataInput[numBytes - i] << (8 * (i));
}
stick.buttons.count = buttonCount;