Skip to content

Commit

Permalink
feat(hid): Enhance consumer report to support higher codes
Browse files Browse the repository at this point in the history
Switch from single byte to double byte usages.

Allow the entire 0x0C page for future compatibility.

Closes zmkfirmware#234.  Co-requisite of zmkfirmware#21.
  • Loading branch information
innovaker authored and petejohanson committed Nov 4, 2020
1 parent b4c4bce commit 264dc73
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/include/zmk/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,20 @@ static const u8_t zmk_hid_report_desc[] = {
/* LOGICAL_MINIMUM (0) */
HID_GI_LOGICAL_MIN(1),
0x00,
/* LOGICAL_MAXIMUM (1) */
HID_GI_LOGICAL_MAX(1),
/* LOGICAL_MAXIMUM (0xFFFF) */
HID_GI_LOGICAL_MAX(2),
0xFF,
0xFF,
HID_LI_USAGE_MIN(1),
0x00,
/* USAGE_MAXIMUM (Keyboard Application) */
HID_LI_USAGE_MAX(1),
/* USAGE_MAXIMUM (0xFFFF) */
HID_LI_USAGE_MAX(2),
0xFF,
0xFF,
/* INPUT (Data,Ary,Abs) */
/* REPORT_SIZE (8) */
/* REPORT_SIZE (16) */
HID_GI_REPORT_SIZE,
0x08,
0x10,
/* REPORT_COUNT (ZMK_HID_CONSUMER_NKRO_SIZE) */
HID_GI_REPORT_COUNT,
ZMK_HID_CONSUMER_NKRO_SIZE,
Expand Down Expand Up @@ -156,7 +158,7 @@ struct zmk_hid_keypad_report {
} __packed;

struct zmk_hid_consumer_report_body {
u8_t keys[ZMK_HID_CONSUMER_NKRO_SIZE];
u16_t keys[ZMK_HID_CONSUMER_NKRO_SIZE];
} __packed;

struct zmk_hid_consumer_report {
Expand Down

0 comments on commit 264dc73

Please sign in to comment.