summaryrefslogtreecommitdiff
path: root/src/class/cdc
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-01 19:29:56 +0700
committerhathach <[email protected]>2019-05-01 19:29:56 +0700
commitc006f3dbce7820bbdc2c1736ba0cb4a4e629f0b6 (patch)
tree4f17a56b9e93a95bbad997f7ac59199c4a9ecbfd /src/class/cdc
parent90fdae94f8f0f86af5e7be3b14561baae1abb2fd (diff)
adding optional ep out for hid
refactor usbd_open_edpt_pair
Diffstat (limited to 'src/class/cdc')
-rw-r--r--src/class/cdc/cdc_device.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c
index c194aacd8..5e0f4e3f7 100644
--- a/src/class/cdc/cdc_device.c
+++ b/src/class/cdc/cdc_device.c
@@ -289,14 +289,12 @@ bool cdcd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t
(TUSB_CLASS_CDC_DATA == ((tusb_desc_interface_t const *) p_desc)->bInterfaceClass) )
{
// next to endpoint descriptor
- (*p_length) += tu_desc_len(p_desc);
p_desc = tu_desc_next(p_desc);
- // Open endpoint pair with usbd helper
- tusb_desc_endpoint_t const *p_desc_ep = (tusb_desc_endpoint_t const *) p_desc;
- TU_ASSERT( usbd_open_edpt_pair(rhport, p_desc_ep, TUSB_XFER_BULK, &p_cdc->ep_out, &p_cdc->ep_in) );
+ // Open endpoint pair
+ TU_ASSERT( usbd_open_edpt_pair(rhport, p_desc, 2, TUSB_XFER_BULK, &p_cdc->ep_out, &p_cdc->ep_in) );
- (*p_length) += 2*sizeof(tusb_desc_endpoint_t);
+ (*p_length) += sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);
}
// Prepare for incoming data