From ebb243aacee704cf5bbb63b65439c06703ba5bc1 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 25 Feb 2020 12:18:11 +1100 Subject: Improvements to extrakey HID descriptors (#8156) --- tmk_core/protocol/arm_atsam/main_arm_atsam.c | 1 - tmk_core/protocol/arm_atsam/usb/udi_device_conf.h | 4 +- tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c | 56 +++++++++++------------ 3 files changed, 29 insertions(+), 32 deletions(-) (limited to 'tmk_core/protocol/arm_atsam') diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index 9c8073dd9e..e952a427ef 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -130,7 +130,6 @@ void send_extra(uint8_t report_id, uint16_t data) { void send_system(uint16_t data) { #ifdef EXTRAKEY_ENABLE - if (data != 0) data = data - SYSTEM_POWER_DOWN + 1; send_extra(REPORT_ID_SYSTEM, data); #endif // EXTRAKEY_ENABLE } diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h index f22f5003ab..80556205f2 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h @@ -327,7 +327,7 @@ typedef struct { } udi_hid_exk_desc_t; typedef struct { - uint8_t array[54]; + uint8_t array[50]; } udi_hid_exk_report_desc_t; # define UDI_HID_EXK_DESC \ @@ -429,7 +429,7 @@ typedef struct { } udi_hid_raw_desc_t; typedef struct { - uint8_t array[27]; + uint8_t array[26]; } udi_hid_raw_report_desc_t; # define UDI_HID_RAW_DESC \ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c index c3952d50c8..45a432678b 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -373,35 +373,33 @@ static uint8_t udi_hid_exk_report_trans[UDI_HID_EXK_REPORT_SIZE]; COMPILER_WORD_ALIGNED UDC_DESC_STORAGE udi_hid_exk_report_desc_t udi_hid_exk_report_desc = {{ - // System Control Collection (8 bits) - - 0x05, 0x01, // Usage Page (Generic Desktop), - 0x09, 0x80, // Usage (System Control), - 0xA1, 0x01, // Collection (Application), - 0x85, REPORT_ID_SYSTEM, // Report ID (2) (System), - 0x16, 0x01, 0x00, // Logical Minimum (1), - 0x26, 0x03, 0x00, // Logical Maximum (3), - 0x1A, 0x81, 0x00, // Usage Minimum (81) (System Power Down), - 0x2A, 0x83, 0x00, // Usage Maximum (83) (System Wake Up), - 0x75, 0x10, // Report Size (16), - 0x95, 0x01, // Report Count (1), - 0x81, 0x00, // Input (Data, Array), - 0xC0, // End Collection - System Control - - // Consumer Control Collection - Media Keys (16 bits) - - 0x05, 0x0C, // Usage Page (Consumer), - 0x09, 0x01, // Usage (Consumer Control), - 0xA1, 0x01, // Collection (Application), - 0x85, REPORT_ID_CONSUMER, // Report ID (3) (Consumer), - 0x16, 0x01, 0x00, // Logical Minimum (1), - 0x26, 0x9C, 0x02, // Logical Maximum (668), - 0x1A, 0x01, 0x00, // Usage Minimum (1), - 0x2A, 0x9C, 0x02, // Usage Maximum (668), - 0x75, 0x10, // Report Size (16), - 0x95, 0x01, // Report Count (1), - 0x81, 0x00, // Input (Data, Array), - 0xC0, // End Collection - Consumer Control + // clang-format off + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x80, // Usage (System Control) + 0xA1, 0x01, // Collection (Application) + 0x85, REPORT_ID_SYSTEM, // Report ID + 0x19, 0x01, // Usage Minimum (Pointer) + 0x2A, 0xB7, 0x00, // Usage Maximum (System Display LCD Autoscale) + 0x15, 0x01, // Logical Minimum + 0x26, 0xB7, 0x00, // Logical Maximum + 0x95, 0x01, // Report Count (1) + 0x75, 0x10, // Report Size (16) + 0x81, 0x00, // Input (Data, Array, Absolute) + 0xC0, // End Collection + + 0x05, 0x0C, // Usage Page (Consumer) + 0x09, 0x01, // Usage (Consumer Control) + 0xA1, 0x01, // Collection (Application) + 0x85, REPORT_ID_CONSUMER, // Report ID + 0x19, 0x01, // Usage Minimum (Consumer Control) + 0x2A, 0xA0, 0x02, // Usage Maximum (AC Desktop Show All Applications) + 0x15, 0x01, // Logical Minimum + 0x26, 0xA0, 0x02, // Logical Maximum + 0x95, 0x01, // Report Count (1) + 0x75, 0x10, // Report Size (16) + 0x81, 0x00, // Input (Data, Array, Absolute) + 0xC0 // End Collection + //clang-format on }}; static bool udi_hid_exk_setreport(void); -- cgit v1.2.3