summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--class/hid/usbh_hid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/class/hid/usbh_hid.c b/class/hid/usbh_hid.c
index 7dddf915..16e15adb 100644
--- a/class/hid/usbh_hid.c
+++ b/class/hid/usbh_hid.c
@@ -122,7 +122,7 @@ int usbh_hid_set_protocol(struct usbh_hid *hid_class, uint8_t protocol)
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
setup->bRequest = HID_REQUEST_SET_PROTOCOL;
setup->wValue = protocol;
- setup->wIndex = 0;
+ setup->wIndex = hid_class->intf;
setup->wLength = 0;
return usbh_control_transfer(hid_class->hport, setup, NULL);
@@ -164,7 +164,7 @@ int usbh_hid_set_report(struct usbh_hid *hid_class, uint8_t report_type, uint8_t
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
setup->bRequest = HID_REQUEST_SET_REPORT;
setup->wValue = (uint16_t)(((uint32_t)report_type << 8U) | (uint32_t)report_id);
- setup->wIndex = 0;
+ setup->wIndex = hid_class->intf;
setup->wLength = buflen;
return usbh_control_transfer(hid_class->hport, setup, buffer);
@@ -182,7 +182,7 @@ int usbh_hid_get_report(struct usbh_hid *hid_class, uint8_t report_type, uint8_t
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
setup->bRequest = HID_REQUEST_GET_REPORT;
setup->wValue = (uint16_t)(((uint32_t)report_type << 8U) | (uint32_t)report_id);
- setup->wIndex = 0;
+ setup->wIndex = hid_class->intf;
setup->wLength = buflen;
return usbh_control_transfer(hid_class->hport, setup, buffer);