From 688f2e673c81873779c848a55a81acd3493556b9 Mon Sep 17 00:00:00 2001 From: Robert Fisk Date: Sun, 14 Jan 2018 00:04:42 +1300 Subject: [PATCH] Support HID mouse reports with an ID header (Lenovo) --- Downstream/Inc/downstream_hid.h | 1 + Downstream/Src/downstream_hid.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Downstream/Inc/downstream_hid.h b/Downstream/Inc/downstream_hid.h index b011aa8..bd559cf 100644 --- a/Downstream/Inc/downstream_hid.h +++ b/Downstream/Inc/downstream_hid.h @@ -51,6 +51,7 @@ #define HID_ITEM_REPORT_SIZE 0x74 //'global' report size #define HID_ITEM_REPORT_COUNT 0x94 //'global' report count +#define HID_ITEM_REPORT_ID 0x84 #define HID_ITEM_INPUT 0x80 //'main' input #define HID_ITEM_INPUT_ABS 0x02 diff --git a/Downstream/Src/downstream_hid.c b/Downstream/Src/downstream_hid.c index 859ea8a..1dc717a 100644 --- a/Downstream/Src/downstream_hid.c +++ b/Downstream/Src/downstream_hid.c @@ -152,6 +152,10 @@ static HAL_StatusTypeDef Downstream_HID_Mouse_ParseReportDescriptor(void) currentReportCount = ItemData; break; + case HID_ITEM_REPORT_ID: + currentReportBitIndex += 8; //Rudimentary support for a single report ID + break; + case HID_ITEM_INPUT: switch (currentUsagePage) {