From 7e795bf4f92c4ece01dd20703a1ca5ad7d217c6b Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Tue, 27 Oct 2020 17:38:49 +0000 Subject: [PATCH] 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. --- app/include/zmk/hid.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/include/zmk/hid.h b/app/include/zmk/hid.h index 61b2d649..e53a8e4c 100644 --- a/app/include/zmk/hid.h +++ b/app/include/zmk/hid.h @@ -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, @@ -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 {