summaryrefslogtreecommitdiff
path: root/src/class/cdc/cdc_device.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-07-13 17:48:26 +0700
committerhathach <[email protected]>2018-07-13 17:48:26 +0700
commit1efb552bfd097a23651bbb5ad29b6d8eb3bc9ccd (patch)
tree2d6301a8058d3a631dde379515b3185992ab1422 /src/class/cdc/cdc_device.c
parentcd5b5d3a53adb465ac614b6027e16c8ec987b09e (diff)
add ep2drv, rename descriptor offset
Diffstat (limited to 'src/class/cdc/cdc_device.c')
-rw-r--r--src/class/cdc/cdc_device.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c
index 643706269..76526d40b 100644
--- a/src/class/cdc/cdc_device.c
+++ b/src/class/cdc/cdc_device.c
@@ -192,31 +192,31 @@ tusb_error_t cdcd_open(uint8_t rhport, tusb_desc_interface_t const * p_interface
(*p_length) = sizeof(tusb_desc_interface_t);
// Communication Functional Descriptors
- while( TUSB_DESC_CLASS_SPECIFIC == p_desc[DESCRIPTOR_OFFSET_TYPE] )
+ while( TUSB_DESC_CLASS_SPECIFIC == p_desc[DESC_OFFSET_TYPE] )
{
- (*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH];
+ (*p_length) += p_desc[DESC_OFFSET_LEN];
p_desc = descriptor_next(p_desc);
}
- if ( TUSB_DESC_ENDPOINT == p_desc[DESCRIPTOR_OFFSET_TYPE])
+ if ( TUSB_DESC_ENDPOINT == p_desc[DESC_OFFSET_TYPE])
{ // notification endpoint if any
TU_ASSERT( dcd_edpt_open(rhport, (tusb_desc_endpoint_t const *) p_desc), TUSB_ERROR_DCD_OPEN_PIPE_FAILED);
p_cdc->ep_notif = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
- (*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH];
+ (*p_length) += p_desc[DESC_OFFSET_LEN];
p_desc = descriptor_next(p_desc);
}
//------------- Data Interface (if any) -------------//
- if ( (TUSB_DESC_INTERFACE == p_desc[DESCRIPTOR_OFFSET_TYPE]) &&
+ if ( (TUSB_DESC_INTERFACE == p_desc[DESC_OFFSET_TYPE]) &&
(TUSB_CLASS_CDC_DATA == ((tusb_desc_interface_t const *) p_desc)->bInterfaceClass) )
{
// p_cdc->itf_num =
p_cdc->ep_count += ((tusb_desc_interface_t const *) p_desc)->bNumEndpoints;
// next to endpoint descritpor
- (*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH];
+ (*p_length) += p_desc[DESC_OFFSET_LEN];
p_desc = descriptor_next(p_desc);
// Open endpoint pair with usbd helper