@ -25,6 +25,10 @@
#define HID_ITEM_USAGE_PAGE_BUTTON 0x09
#define HID_ITEM_USAGE_PAGE_DESKTOP 0x01
#define HID_ITEM_COLLECTION 0xA1
#define HID_ITEM_COLLECTION_PHYS 0x00
#define HID_ITEM_END_COLLECTION 0xC0
#define HID_ITEM_USAGE 0x09 //'local' usage
#define HID_ITEM_USAGE_X 0x30
#define HID_ITEM_USAGE_Y 0x31
@ -106,6 +106,23 @@ HAL_StatusTypeDef Downstream_HID_Mouse_ParseReportDescriptor(void)
wheelUsageIndex = 0xFF;
break;
case HID_ITEM_COLLECTION: //Physical collections also clear the usage index...
if (ItemData == HID_ITEM_COLLECTION_PHYS)
{
currentUsageIndex = 0;
xUsageIndex = 0xFF;
yUsageIndex = 0xFF;
}
case HID_ITEM_END_COLLECTION: //...and so do collection ends
case HID_ITEM_USAGE:
switch (ItemData)