summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2022-09-25 17:32:27 +0800
committersakumisu <[email protected]>2022-09-25 17:32:27 +0800
commit7021e0b096a5c7eac41eb6c324d443664f09d307 (patch)
tree698599432ea80bf8cc2beae59005804177aaceb6
parent34a1d171cea659fdbe0b906cfa389c24a3ec87c7 (diff)
fix hid duration
-rw-r--r--class/hid/usbd_hid.c2
-rw-r--r--class/hid/usbh_hid.c6
2 files changed, 1 insertions, 7 deletions
diff --git a/class/hid/usbd_hid.c b/class/hid/usbd_hid.c
index 12a69cf1..1f47bb3f 100644
--- a/class/hid/usbd_hid.c
+++ b/class/hid/usbd_hid.c
@@ -90,7 +90,7 @@ static int hid_class_interface_request_handler(struct usb_setup_packet *setup, u
break;
case HID_REQUEST_SET_IDLE:
/* report id, duration */
- usbh_hid_set_idle(intf_num, LO_BYTE(setup->wValue), HI_BYTE(setup->wIndex));
+ usbh_hid_set_idle(intf_num, LO_BYTE(setup->wValue), HI_BYTE(setup->wValue));
break;
case HID_REQUEST_SET_PROTOCOL:
/* protocol */
diff --git a/class/hid/usbh_hid.c b/class/hid/usbh_hid.c
index 99909e90..6794a307 100644
--- a/class/hid/usbh_hid.c
+++ b/class/hid/usbh_hid.c
@@ -84,13 +84,7 @@ int usbh_hid_set_idle(struct usbh_hid *hid_class, uint8_t report_id, uint8_t dur
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
setup->bRequest = HID_REQUEST_SET_IDLE;
- //setup->wValue = report_id;
- //setup->wIndex = (duration << 8) | hid_class->intf;
- /* wValue, high-bytes sets the duration, or the max amount of time between reports
- 0x00 = hid will send a report only when report data has changed or duration time elapsed
- low-bytes indicate the report id that the requeset applies to */
setup->wValue = (duration << 8) | report_id;
- /* wIndex, num of interface that supports the request */
setup->wIndex = hid_class->intf;
setup->wLength = 0;