diff options
| author | hathach <[email protected]> | 2020-05-28 13:48:02 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-05-28 13:48:02 +0700 |
| commit | 10cd3f24bf0af9b7a1f357505ebbb5ef2132e34b (patch) | |
| tree | 36c1c14d5d53651ab32bdc0b08e15278da92ed57 /src/class/hid | |
| parent | c1db36a15c1e38adc142ec74fd5f3b0320053cc9 (diff) | |
initial transfer failed in open() shouldn't cause the driver open to fail.
Diffstat (limited to 'src/class/hid')
| -rw-r--r-- | src/class/hid/hid_device.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c index 51bd153ec..64a57e90e 100644 --- a/src/class/hid/hid_device.c +++ b/src/class/hid/hid_device.c @@ -196,7 +196,14 @@ uint16_t hidd_open(uint8_t rhport, tusb_desc_interface_t const * desc_itf, uint1 memcpy(&p_hid->report_desc_len, &(p_hid->hid_descriptor->wReportLength), 2); // Prepare for output endpoint - if (p_hid->ep_out) TU_ASSERT(usbd_edpt_xfer(rhport, p_hid->ep_out, p_hid->epout_buf, sizeof(p_hid->epout_buf)), 0); + if (p_hid->ep_out) + { + if ( !usbd_edpt_xfer(rhport, p_hid->ep_out, p_hid->epout_buf, sizeof(p_hid->epout_buf)) ) + { + TU_LOG1_FAILED(); + TU_BREAKPOINT(); + } + } return sizeof(tusb_desc_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + desc_itf->bNumEndpoints*sizeof(tusb_desc_endpoint_t); } |
