fix(hid): Basic consumer code fixes for signed logical max.

* Logical max values are signed, so for the report descriptor, use a two
  byte logical max descriptor item to impart proper 0xFF max logical
  value.
This commit is contained in:
Peter Johanson 2021-11-08 21:21:01 +00:00 committed by Pete Johanson
parent c412fad40d
commit f8018b22d0
1 changed files with 5 additions and 3 deletions

View File

@ -143,12 +143,14 @@ static const uint8_t zmk_hid_report_desc[] = {
/* LOGICAL_MINIMUM (0) */
HID_GI_LOGICAL_MIN(1),
0x00,
/* LOGICAL_MAXIMUM (0xFFFF) */
HID_GI_LOGICAL_MAX(1),
/* LOGICAL_MAXIMUM (0x00FF) - little endian, and requires two bytes because logical max is
signed */
HID_GI_LOGICAL_MAX(2),
0xFF,
0x00,
HID_LI_USAGE_MIN(1),
0x00,
/* USAGE_MAXIMUM (0xFFFF) */
/* USAGE_MAXIMUM (0xFF) */
HID_LI_USAGE_MAX(1),
0xFF,
/* INPUT (Data,Ary,Abs) */