keyboardio / KeyboardioHID

A HID library for Arduino
MIT License
34 stars 17 forks source link

Revert the Mouse USB HID descriptor change, and fix hWheel better #22

Closed algernon closed 6 years ago

algernon commented 6 years ago

As it turns out, the real problem was two typos, D_USAGE_MINIMUM and D_USAGE_MAXIMUM were used in the horizontal wheel descriptor instead of D_LOGICAL_MINIMUM and D_LOGICAL_MAXIMUM.

This patch reverts the previous USB HID descriptor rework, and fixes the horizontal wheel descriptor only, saving us some 46 bytes of program space.

Tested & works on Linux, but to make sure we don't re-break OSX, testing there would be most appreciated.

algernon commented 6 years ago

The downside of this revert & fix is that we lose the nicely formatted comments. Mind you, the indentation of that wasn't particularly great...

If needed, I'll add similar contents to this PR, once verified that it works on OSX & Windows too.

obra commented 6 years ago

Fixups applied here: https://github.com/keyboardio/KeyboardioHID/compare/master...keyboardio:algernon-f/mouse/even-better-usb-descriptors?expand=1

It uncovered what looks like a bug in report count

algernon commented 6 years ago

Updated my branch with yours, thanks!

As explained above, the report count is correct now, it did change from 2 back to 3 now. The previous comment was wrong.