HID parser and wheel support works!

pull/7/head
Robert Fisk 9 years ago
parent 35d54056c4
commit 4b9607dbc3

@ -170,7 +170,7 @@ HAL_StatusTypeDef Downstream_HID_Mouse_ParseReportDescriptor(void)
ReportYBitOffset = currentReportBitIndex + (currentReportSize * yUsageIndex); ReportYBitOffset = currentReportBitIndex + (currentReportSize * yUsageIndex);
ReportYBitLength = currentReportSize; ReportYBitLength = currentReportSize;
} }
if (xUsageIndex != 0xFF) if (wheelUsageIndex != 0xFF)
{ {
ReportWheelBitOffset = currentReportBitIndex + (currentReportSize * wheelUsageIndex); ReportWheelBitOffset = currentReportBitIndex + (currentReportSize * wheelUsageIndex);
ReportWheelBitLength = currentReportSize; ReportWheelBitLength = currentReportSize;
@ -179,7 +179,7 @@ HAL_StatusTypeDef Downstream_HID_Mouse_ParseReportDescriptor(void)
break; break;
} }
currentReportBitIndex += (currentReportSize * currentReportCount); currentReportBitIndex += (currentReportSize * currentReportCount);
if (currentReportBitIndex < (HID_MAX_REPORT_LEN * 8)) if (currentReportBitIndex >= (HID_MAX_REPORT_LEN * 8))
{ {
return HAL_ERROR; return HAL_ERROR;
} }

@ -17,7 +17,7 @@
#include "usbd_hid.h" #include "usbd_hid.h"
#define HID_MOUSE_DATA_LEN 3 #define HID_MOUSE_DATA_LEN 4
#define HID_KEYBOARD_DATA_LEN 0 #define HID_KEYBOARD_DATA_LEN 0

Loading…
Cancel
Save