diff options
| author | sakumisu <[email protected]> | 2026-05-19 21:03:20 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2026-05-19 21:03:20 +0800 |
| commit | 9b95c1d61751640b0678be8971c06ca68ae42276 (patch) | |
| tree | 7ad8425218534b79933938134bd2244932a8c762 | |
| parent | 259e18b9b3ffd318a8e69172e4da6d006dc0f0cc (diff) | |
fix(class/hid/usbh_hid): fix missing hport->intf
Signed-off-by: sakumisu <[email protected]>
| -rw-r--r-- | class/hid/usbh_hid.c | 6 |
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); |
