mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-21 21:41:09 +00:00
Merge pull request #1123 from Daft-Freak/patch-1
Handle HID devices with OUT endpoint listed first
This commit is contained in:
commit
9660a5821f
@ -291,7 +291,15 @@ bool hidh_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *de
|
|||||||
tusb_desc_endpoint_t const * desc_ep = (tusb_desc_endpoint_t const *) p_desc;
|
tusb_desc_endpoint_t const * desc_ep = (tusb_desc_endpoint_t const *) p_desc;
|
||||||
TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType);
|
TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType);
|
||||||
|
|
||||||
|
// first endpoint may be OUT, skip to IN endpoint
|
||||||
// TODO also open endpoint OUT
|
// TODO also open endpoint OUT
|
||||||
|
if(tu_edpt_dir(desc_ep->bEndpointAddress) == TUSB_DIR_OUT)
|
||||||
|
{
|
||||||
|
p_desc = tu_desc_next(p_desc);
|
||||||
|
desc_ep = (tusb_desc_endpoint_t const *) p_desc;
|
||||||
|
TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType);
|
||||||
|
}
|
||||||
|
|
||||||
TU_ASSERT( usbh_edpt_open(rhport, dev_addr, desc_ep) );
|
TU_ASSERT( usbh_edpt_open(rhport, dev_addr, desc_ep) );
|
||||||
|
|
||||||
hidh_interface_t* hid_itf = get_instance(dev_addr, hid_dev->inst_count);
|
hidh_interface_t* hid_itf = get_instance(dev_addr, hid_dev->inst_count);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user