if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, \r
DComp_CDC_Host_NextCDCDataInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
{\r
- /* Descriptor not found, error out */\r
return CDC_ENUMERROR_NoCDCInterfaceFound;\r
}\r
}\r
{\r
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
{\r
- /* Check the CDC descriptor class, subclass and protocol, break out if correct control interface found */\r
- if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_CONTROL_CLASS) &&\r
- (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CONTROL_SUBCLASS) &&\r
- (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CONTROL_PROTOCOL))\r
+ USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,\r
+ USB_Descriptor_Interface_t);\r
+ \r
+ if ((CurrentInterface->Class == CDC_CONTROL_CLASS) &&\r
+ (CurrentInterface->SubClass == CDC_CONTROL_SUBCLASS) &&\r
+ (CurrentInterface->Protocol == CDC_CONTROL_PROTOCOL))\r
{\r
return DESCRIPTOR_SEARCH_Found;\r
}\r
{\r
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
{\r
- /* Check the CDC descriptor class, subclass and protocol, break out if correct data interface found */\r
- if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == CDC_DATA_CLASS) &&\r
- (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_DATA_SUBCLASS) &&\r
- (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_DATA_PROTOCOL))\r
+ USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,\r
+ USB_Descriptor_Interface_t);\r
+ \r
+ if ((CurrentInterface->Class == CDC_DATA_CLASS) &&\r
+ (CurrentInterface->SubClass == CDC_DATA_SUBCLASS) &&\r
+ (CurrentInterface->Protocol == CDC_DATA_PROTOCOL))\r
{\r
return DESCRIPTOR_SEARCH_Found;\r
}\r
{\r
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
{\r
- uint8_t EndpointType = (DESCRIPTOR_CAST(CurrentDescriptor,\r
- USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK);\r
+ USB_Descriptor_Endpoint_t* CurrentEndpoint = DESCRIPTOR_PCAST(CurrentDescriptor,\r
+ USB_Descriptor_Endpoint_t)\r
+ \r
+ uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);\r
\r
if ((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT))\r
return DESCRIPTOR_SEARCH_Found;\r
USB_HostState = HOST_STATE_Configured;\r
break;\r
case HOST_STATE_Configured:\r
- \r
USB_HostState = HOST_STATE_Ready;\r
break;\r
}\r