shorten TUSB_DESC_TYPE*
This commit is contained in:
		| @@ -142,7 +142,7 @@ tusb_error_t cdcd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter | ||||
|   //------------- Communication Interface -------------// | ||||
|   (*p_length) = sizeof(tusb_descriptor_interface_t); | ||||
|  | ||||
|   while( TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC == p_desc[DESCRIPTOR_OFFSET_TYPE] ) | ||||
|   while( TUSB_DESC_CLASS_SPECIFIC == p_desc[DESCRIPTOR_OFFSET_TYPE] ) | ||||
|   { // Communication Functional Descriptors | ||||
|     if ( CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT == cdc_functional_desc_typeof(p_desc) ) | ||||
|     { // save ACM bmCapabilities | ||||
| @@ -153,7 +153,7 @@ tusb_error_t cdcd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter | ||||
|     p_desc = descriptor_next(p_desc); | ||||
|   } | ||||
|  | ||||
|   if ( TUSB_DESC_TYPE_ENDPOINT == p_desc[DESCRIPTOR_OFFSET_TYPE]) | ||||
|   if ( TUSB_DESC_ENDPOINT == p_desc[DESCRIPTOR_OFFSET_TYPE]) | ||||
|   { // notification endpoint if any | ||||
|     TU_ASSERT( tusb_dcd_edpt_open(port, (tusb_descriptor_endpoint_t const *) p_desc), TUSB_ERROR_DCD_OPEN_PIPE_FAILED); | ||||
|  | ||||
| @@ -164,7 +164,7 @@ tusb_error_t cdcd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter | ||||
|   } | ||||
|  | ||||
|   //------------- Data Interface (if any) -------------// | ||||
|   if ( (TUSB_DESC_TYPE_INTERFACE == p_desc[DESCRIPTOR_OFFSET_TYPE]) && | ||||
|   if ( (TUSB_DESC_INTERFACE == p_desc[DESCRIPTOR_OFFSET_TYPE]) && | ||||
|        (TUSB_CLASS_CDC_DATA      == ((tusb_descriptor_interface_t const *) p_desc)->bInterfaceClass) ) | ||||
|   { | ||||
|     (*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH]; | ||||
| @@ -174,7 +174,7 @@ tusb_error_t cdcd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter | ||||
|     for(uint32_t i=0; i<2; i++) | ||||
|     { | ||||
|       tusb_descriptor_endpoint_t const *p_endpoint = (tusb_descriptor_endpoint_t const *) p_desc; | ||||
|       TU_ASSERT(TUSB_DESC_TYPE_ENDPOINT == p_endpoint->bDescriptorType, TUSB_ERROR_DESCRIPTOR_CORRUPTED); | ||||
|       TU_ASSERT(TUSB_DESC_ENDPOINT == p_endpoint->bDescriptorType, TUSB_ERROR_DESCRIPTOR_CORRUPTED); | ||||
|       TU_ASSERT(TUSB_XFER_BULK == p_endpoint->bmAttributes.xfer, TUSB_ERROR_DESCRIPTOR_CORRUPTED); | ||||
|  | ||||
|       TU_ASSERT( tusb_dcd_edpt_open(port, p_endpoint), TUSB_ERROR_DCD_OPEN_PIPE_FAILED); | ||||
|   | ||||
| @@ -167,7 +167,7 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con | ||||
|   //------------- Communication Interface -------------// | ||||
|   (*p_length) = sizeof(tusb_descriptor_interface_t); | ||||
|  | ||||
|   while( TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC == p_desc[DESCRIPTOR_OFFSET_TYPE] ) | ||||
|   while( TUSB_DESC_CLASS_SPECIFIC == p_desc[DESCRIPTOR_OFFSET_TYPE] ) | ||||
|   { // Communication Functional Descriptors | ||||
|     if ( CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT == cdc_functional_desc_typeof(p_desc) ) | ||||
|     { // save ACM bmCapabilities | ||||
| @@ -178,7 +178,7 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con | ||||
|     p_desc = descriptor_next(p_desc); | ||||
|   } | ||||
|  | ||||
|   if ( TUSB_DESC_TYPE_ENDPOINT == p_desc[DESCRIPTOR_OFFSET_TYPE]) | ||||
|   if ( TUSB_DESC_ENDPOINT == p_desc[DESCRIPTOR_OFFSET_TYPE]) | ||||
|   { // notification endpoint if any | ||||
|     p_cdc->pipe_notification = hcd_pipe_open(dev_addr, (tusb_descriptor_endpoint_t const *) p_desc, TUSB_CLASS_CDC); | ||||
|  | ||||
| @@ -189,7 +189,7 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con | ||||
|   } | ||||
|  | ||||
|   //------------- Data Interface (if any) -------------// | ||||
|   if ( (TUSB_DESC_TYPE_INTERFACE == p_desc[DESCRIPTOR_OFFSET_TYPE]) && | ||||
|   if ( (TUSB_DESC_INTERFACE == p_desc[DESCRIPTOR_OFFSET_TYPE]) && | ||||
|        (TUSB_CLASS_CDC_DATA      == ((tusb_descriptor_interface_t const *) p_desc)->bInterfaceClass) ) | ||||
|   { | ||||
|     (*p_length) += p_desc[DESCRIPTOR_OFFSET_LENGTH]; | ||||
| @@ -199,7 +199,7 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con | ||||
|     for(uint32_t i=0; i<2; i++) | ||||
|     { | ||||
|       tusb_descriptor_endpoint_t const *p_endpoint = (tusb_descriptor_endpoint_t const *) p_desc; | ||||
|       ASSERT_INT(TUSB_DESC_TYPE_ENDPOINT, p_endpoint->bDescriptorType, TUSB_ERROR_USBH_DESCRIPTOR_CORRUPTED); | ||||
|       ASSERT_INT(TUSB_DESC_ENDPOINT, p_endpoint->bDescriptorType, TUSB_ERROR_USBH_DESCRIPTOR_CORRUPTED); | ||||
|       ASSERT_INT(TUSB_XFER_BULK, p_endpoint->bmAttributes.xfer, TUSB_ERROR_USBH_DESCRIPTOR_CORRUPTED); | ||||
|  | ||||
|       pipe_handle_t * p_pipe_hdl =  ( p_endpoint->bEndpointAddress &  TUSB_DIR_IN_MASK ) ? | ||||
|   | ||||
| @@ -117,7 +117,7 @@ tusb_error_t cush_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con | ||||
|   for(uint32_t i=0; i<2; i++) | ||||
|   { | ||||
|     tusb_descriptor_endpoint_t const *p_endpoint = (tusb_descriptor_endpoint_t const *) p_desc; | ||||
|     ASSERT_INT(TUSB_DESC_TYPE_ENDPOINT, p_endpoint->bDescriptorType, TUSB_ERROR_INVALID_PARA); | ||||
|     ASSERT_INT(TUSB_DESC_ENDPOINT, p_endpoint->bDescriptorType, TUSB_ERROR_INVALID_PARA); | ||||
|  | ||||
|     pipe_handle_t * p_pipe_hdl =  ( p_endpoint->bEndpointAddress &  TUSB_DIR_IN_MASK ) ? | ||||
|                          &custom_interface[dev_addr-1].pipe_in : &custom_interface[dev_addr-1].pipe_out; | ||||
|   | ||||
| @@ -266,7 +266,7 @@ tusb_error_t hidd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter | ||||
|   //------------- Endpoint Descriptor -------------// | ||||
|   p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; | ||||
|   tusb_descriptor_endpoint_t const *p_desc_endpoint = (tusb_descriptor_endpoint_t const *) p_desc; | ||||
|   ASSERT_INT(TUSB_DESC_TYPE_ENDPOINT, p_desc_endpoint->bDescriptorType, TUSB_ERROR_HIDD_DESCRIPTOR_INTERFACE); | ||||
|   ASSERT_INT(TUSB_DESC_ENDPOINT, p_desc_endpoint->bDescriptorType, TUSB_ERROR_HIDD_DESCRIPTOR_INTERFACE); | ||||
|  | ||||
|   if (p_interface_desc->bInterfaceSubClass == HID_SUBCLASS_BOOT) | ||||
|   { | ||||
|   | ||||
| @@ -193,7 +193,7 @@ tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con | ||||
|   //------------- Endpoint Descriptor -------------// | ||||
|   p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; | ||||
|   tusb_descriptor_endpoint_t const * p_endpoint_desc = (tusb_descriptor_endpoint_t const *) p_desc; | ||||
|   ASSERT_INT(TUSB_DESC_TYPE_ENDPOINT, p_endpoint_desc->bDescriptorType, TUSB_ERROR_INVALID_PARA); | ||||
|   ASSERT_INT(TUSB_DESC_ENDPOINT, p_endpoint_desc->bDescriptorType, TUSB_ERROR_INVALID_PARA); | ||||
|  | ||||
|   OSAL_SUBTASK_BEGIN | ||||
|  | ||||
|   | ||||
| @@ -95,7 +95,7 @@ tusb_error_t mscd_open(uint8_t port, tusb_descriptor_interface_t const * p_inter | ||||
|   tusb_descriptor_endpoint_t const *p_endpoint = (tusb_descriptor_endpoint_t const *) descriptor_next( (uint8_t const*) p_interface_desc ); | ||||
|   for(uint32_t i=0; i<2; i++) | ||||
|   { | ||||
|     TU_ASSERT(TUSB_DESC_TYPE_ENDPOINT == p_endpoint->bDescriptorType && | ||||
|     TU_ASSERT(TUSB_DESC_ENDPOINT == p_endpoint->bDescriptorType && | ||||
|            TUSB_XFER_BULK == p_endpoint->bmAttributes.xfer, TUSB_ERROR_DESCRIPTOR_CORRUPTED); | ||||
|  | ||||
|     TU_ASSERT( tusb_dcd_edpt_open(port, p_endpoint), TUSB_ERROR_DCD_FAILED ); | ||||
|   | ||||
| @@ -310,7 +310,7 @@ tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con | ||||
|  | ||||
|   for(uint32_t i=0; i<2; i++) | ||||
|   { | ||||
|     SUBTASK_ASSERT(TUSB_DESC_TYPE_ENDPOINT == p_endpoint->bDescriptorType); | ||||
|     SUBTASK_ASSERT(TUSB_DESC_ENDPOINT == p_endpoint->bDescriptorType); | ||||
|     SUBTASK_ASSERT(TUSB_XFER_BULK == p_endpoint->bmAttributes.xfer); | ||||
|  | ||||
|     pipe_handle_t * p_pipe_hdl =  ( p_endpoint->bEndpointAddress &  TUSB_DIR_IN_MASK ) ? | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach