#define INCLUDE_FROM_CDC_CLASS_HOST_C\r
#include "CDC.h"\r
\r
-uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint16_t MaxConfigBufferSize)\r
+uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint16_t ConfigDescriptorSize,\r
+ uint8_t* ConfigDescriptorData)\r
{\r
- uint8_t* ConfigDescriptorData;\r
- uint16_t ConfigDescriptorSize;\r
uint8_t FoundEndpoints = 0;\r
\r
- if (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)\r
- return CDC_ENUMERROR_ControlError;\r
- \r
- if (ConfigDescriptorSize > MaxConfigBufferSize)\r
- return CDC_ENUMERROR_DescriptorTooLarge;\r
- \r
- ConfigDescriptorData = alloca(ConfigDescriptorSize);\r
-\r
- USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData);\r
- \r
if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)\r
- return CDC_ENUMERROR_InvalidConfigDataReturned;\r
+ return CDC_ENUMERROR_InvalidConfigDescriptor;\r
\r
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
DComp_CDC_Host_NextCDCControlInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
DComp_CDC_Host_NextInterfaceCDCDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
{\r
- return CDC_ENUMERROR_NoEndpointFound;\r
+ return CDC_ENUMERROR_EndpointsNotFound;\r
}\r
}\r
\r