diff --git a/bdk/usb/usb_descriptors.c b/bdk/usb/usb_descriptors.c index 252577e..389a70d 100644 --- a/bdk/usb/usb_descriptors.c +++ b/bdk/usb/usb_descriptors.c @@ -429,7 +429,7 @@ static usb_cfg_hid_descr_t usb_configuration_descriptor_hid_jc = .endpoint[0].bEndpointAddress = 0x81, // USB_EP_ADDR_BULK_IN. .endpoint[0].bmAttributes = USB_EP_TYPE_INTR, .endpoint[0].wMaxPacketSize = 0x200, - .endpoint[0].bInterval = 4, // 4ms on FS, 8ms on HS. + .endpoint[0].bInterval = 4, // 8ms on HS. /* Endpoint descriptor structure EP1 OUT */ .endpoint[1].bLength = 7, @@ -437,7 +437,7 @@ static usb_cfg_hid_descr_t usb_configuration_descriptor_hid_jc = .endpoint[1].bEndpointAddress = 0x01, // USB_EP_ADDR_BULK_OUT. .endpoint[1].bmAttributes = USB_EP_TYPE_INTR, .endpoint[1].wMaxPacketSize = 0x200, - .endpoint[1].bInterval = 4 // 4ms on FS, 8ms on HS. + .endpoint[1].bInterval = 4 // 8ms on HS. }; static u8 usb_vendor_string_descriptor_hid[22] = @@ -498,7 +498,7 @@ static usb_cfg_hid_descr_t usb_configuration_descriptor_hid_touch = .endpoint[0].bEndpointAddress = 0x81, // USB_EP_ADDR_BULK_IN. .endpoint[0].bmAttributes = USB_EP_TYPE_INTR, .endpoint[0].wMaxPacketSize = 0x200, - .endpoint[0].bInterval = 4, // 4ms on FS, 8ms on HS. + .endpoint[0].bInterval = 3, // 4ms on HS. /* Endpoint descriptor structure EP1 OUT */ .endpoint[1].bLength = 7, @@ -506,7 +506,7 @@ static usb_cfg_hid_descr_t usb_configuration_descriptor_hid_touch = .endpoint[1].bEndpointAddress = 0x01, // USB_EP_ADDR_BULK_OUT. .endpoint[1].bmAttributes = USB_EP_TYPE_INTR, .endpoint[1].wMaxPacketSize = 0x200, - .endpoint[1].bInterval = 4 // 4ms on FS, 8ms on HS. + .endpoint[1].bInterval = 3 // 4ms on HS. }; usb_desc_t usb_gadget_ums_descriptors = diff --git a/bdk/usb/usbd.c b/bdk/usb/usbd.c index 5787178..a120d9b 100644 --- a/bdk/usb/usbd.c +++ b/bdk/usb/usbd.c @@ -962,11 +962,15 @@ static void _usbd_handle_get_descriptor(bool *transmit_data, void **descriptor, { tmp->endpoint[0].wMaxPacketSize = 0x200; tmp->endpoint[1].wMaxPacketSize = 0x200; + tmp->endpoint[0].bInterval = usbd_otg->gadget == USB_GADGET_HID_GAMEPAD ? 4 : 3; // 8ms : 4ms. + tmp->endpoint[1].bInterval = usbd_otg->gadget == USB_GADGET_HID_GAMEPAD ? 4 : 3; // 8ms : 4ms. } else // Full speed. 64 bytes. { tmp->endpoint[0].wMaxPacketSize = 0x40; tmp->endpoint[1].wMaxPacketSize = 0x40; + tmp->endpoint[0].bInterval = usbd_otg->gadget == USB_GADGET_HID_GAMEPAD ? 8 : 4; // 8ms : 4ms. + tmp->endpoint[1].bInterval = usbd_otg->gadget == USB_GADGET_HID_GAMEPAD ? 8 : 4; // 8ms : 4ms. } } *descriptor = usbd_otg->desc->cfg;