Browse Source

feat(hid): Enhance consumer report to support higher codes

Switch from single byte to double byte usages.

Allow the entire 0x0C page for future compatibility.

Closes #234.  Co-requisite of #21.
xmkb
innovaker 4 years ago committed by Pete Johanson
parent
commit
7e795bf4f9
  1. 16
      app/include/zmk/hid.h

16
app/include/zmk/hid.h

@ -116,18 +116,20 @@ static const u8_t zmk_hid_report_desc[] = {
/* LOGICAL_MINIMUM (0) */ /* LOGICAL_MINIMUM (0) */
HID_GI_LOGICAL_MIN(1), HID_GI_LOGICAL_MIN(1),
0x00, 0x00,
/* LOGICAL_MAXIMUM (1) */ /* LOGICAL_MAXIMUM (0xFFFF) */
HID_GI_LOGICAL_MAX(1), HID_GI_LOGICAL_MAX(2),
0xFF,
0xFF, 0xFF,
HID_LI_USAGE_MIN(1), HID_LI_USAGE_MIN(1),
0x00, 0x00,
/* USAGE_MAXIMUM (Keyboard Application) */ /* USAGE_MAXIMUM (0xFFFF) */
HID_LI_USAGE_MAX(1), HID_LI_USAGE_MAX(2),
0xFF,
0xFF, 0xFF,
/* INPUT (Data,Ary,Abs) */ /* INPUT (Data,Ary,Abs) */
/* REPORT_SIZE (8) */ /* REPORT_SIZE (16) */
HID_GI_REPORT_SIZE, HID_GI_REPORT_SIZE,
0x08, 0x10,
/* REPORT_COUNT (ZMK_HID_CONSUMER_NKRO_SIZE) */ /* REPORT_COUNT (ZMK_HID_CONSUMER_NKRO_SIZE) */
HID_GI_REPORT_COUNT, HID_GI_REPORT_COUNT,
ZMK_HID_CONSUMER_NKRO_SIZE, ZMK_HID_CONSUMER_NKRO_SIZE,
@ -156,7 +158,7 @@ struct zmk_hid_keypad_report {
} __packed; } __packed;
struct zmk_hid_consumer_report_body { struct zmk_hid_consumer_report_body {
u8_t keys[ZMK_HID_CONSUMER_NKRO_SIZE]; u16_t keys[ZMK_HID_CONSUMER_NKRO_SIZE];
} __packed; } __packed;
struct zmk_hid_consumer_report { struct zmk_hid_consumer_report {

Loading…
Cancel
Save