summaryrefslogtreecommitdiff
path: root/tinyusb/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-03-11 21:16:51 +0700
committerhathach <[email protected]>2018-03-11 21:16:51 +0700
commit229a7a23b82d90e34c6fd5b52ef739d3f9668dcb (patch)
tree94d90397f6acf28ccbfdc58fb141122763ec8acb /tinyusb/host
parentd71334c34822c1e7b5b4ecfdcc44c8c3c3843d61 (diff)
shorten TUSB_DESC_TYPE*
Diffstat (limited to 'tinyusb/host')
-rw-r--r--tinyusb/host/hub.c2
-rw-r--r--tinyusb/host/usbh.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/tinyusb/host/hub.c b/tinyusb/host/hub.c
index 447867290..a5ae7ca57 100644
--- a/tinyusb/host/hub.c
+++ b/tinyusb/host/hub.c
@@ -169,7 +169,7 @@ tusb_error_t hub_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t cons
tusb_descriptor_endpoint_t const *p_endpoint;
p_endpoint = (tusb_descriptor_endpoint_t const *) descriptor_next( (uint8_t const*) p_interface_desc );
- SUBTASK_ASSERT(TUSB_DESC_TYPE_ENDPOINT == p_endpoint->bDescriptorType);
+ SUBTASK_ASSERT(TUSB_DESC_ENDPOINT == p_endpoint->bDescriptorType);
SUBTASK_ASSERT(TUSB_XFER_INTERRUPT == p_endpoint->bmAttributes.xfer);
hub_data[dev_addr-1].pipe_status = hcd_pipe_open(dev_addr, p_endpoint, TUSB_CLASS_HUB);
diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c
index b8f030cbc..3650610da 100644
--- a/tinyusb/host/usbh.c
+++ b/tinyusb/host/usbh.c
@@ -450,7 +450,7 @@ tusb_error_t enumeration_body_subtask(void)
//------------- Get first 8 bytes of device descriptor to get Control Endpoint Size -------------//
OSAL_SUBTASK_INVOKED_AND_WAIT(
usbh_control_xfer_subtask( 0, bm_request_type(TUSB_DIR_IN, TUSB_REQ_TYPE_STANDARD, TUSB_REQ_RCPT_DEVICE),
- TUSB_REQUEST_GET_DESCRIPTOR, (TUSB_DESC_TYPE_DEVICE << 8), 0,
+ TUSB_REQUEST_GET_DESCRIPTOR, (TUSB_DESC_DEVICE << 8), 0,
8, enum_data_buffer ),
error
);
@@ -505,7 +505,7 @@ tusb_error_t enumeration_body_subtask(void)
//------------- Get full device descriptor -------------//
OSAL_SUBTASK_INVOKED_AND_WAIT(
usbh_control_xfer_subtask( new_addr, bm_request_type(TUSB_DIR_IN, TUSB_REQ_TYPE_STANDARD, TUSB_REQ_RCPT_DEVICE),
- TUSB_REQUEST_GET_DESCRIPTOR, (TUSB_DESC_TYPE_DEVICE << 8), 0,
+ TUSB_REQUEST_GET_DESCRIPTOR, (TUSB_DESC_DEVICE << 8), 0,
18, enum_data_buffer ),
error
);
@@ -522,7 +522,7 @@ tusb_error_t enumeration_body_subtask(void)
//------------- Get 9 bytes of configuration descriptor -------------//
OSAL_SUBTASK_INVOKED_AND_WAIT(
usbh_control_xfer_subtask( new_addr, bm_request_type(TUSB_DIR_IN, TUSB_REQ_TYPE_STANDARD, TUSB_REQ_RCPT_DEVICE),
- TUSB_REQUEST_GET_DESCRIPTOR, (TUSB_DESC_TYPE_CONFIGURATION << 8) | (configure_selected - 1), 0,
+ TUSB_REQUEST_GET_DESCRIPTOR, (TUSB_DESC_CONFIGURATION << 8) | (configure_selected - 1), 0,
9, enum_data_buffer ),
error
);
@@ -533,7 +533,7 @@ tusb_error_t enumeration_body_subtask(void)
//------------- Get full configuration descriptor -------------//
OSAL_SUBTASK_INVOKED_AND_WAIT(
usbh_control_xfer_subtask( new_addr, bm_request_type(TUSB_DIR_IN, TUSB_REQ_TYPE_STANDARD, TUSB_REQ_RCPT_DEVICE),
- TUSB_REQUEST_GET_DESCRIPTOR, (TUSB_DESC_TYPE_CONFIGURATION << 8) | (configure_selected - 1), 0,
+ TUSB_REQUEST_GET_DESCRIPTOR, (TUSB_DESC_CONFIGURATION << 8) | (configure_selected - 1), 0,
TUSB_CFG_HOST_ENUM_BUFFER_SIZE, enum_data_buffer ),
error
);
@@ -562,7 +562,7 @@ tusb_error_t enumeration_body_subtask(void)
while( p_desc < enum_data_buffer + ((tusb_descriptor_configuration_t*)enum_data_buffer)->wTotalLength )
{
// skip until we see interface descriptor
- if ( TUSB_DESC_TYPE_INTERFACE != p_desc[DESCRIPTOR_OFFSET_TYPE] )
+ if ( TUSB_DESC_INTERFACE != p_desc[DESCRIPTOR_OFFSET_TYPE] )
{
p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; // skip the descriptor, increase by the descriptor's length
}else