aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/USB/Class/Host/CDC.c
diff options
context:
space:
mode:
authorDean Camera <[email protected]>2009-07-27 10:48:55 +0000
committerDean Camera <[email protected]>2009-07-27 10:48:55 +0000
commit84c3c4a3d90e7f890c61d4640c2d65a469b42b79 (patch)
treee498b8aea50aab1aa6931b775c0d68154c7db348 /LUFA/Drivers/USB/Class/Host/CDC.c
parent5251bc6e4e312ec5c4f57c43a92ba49c19684c51 (diff)
downloadqmk_firmware-84c3c4a3d90e7f890c61d4640c2d65a469b42b79.tar.gz
qmk_firmware-84c3c4a3d90e7f890c61d4640c2d65a469b42b79.zip
Change Host mode class driver Pipe configuration routines -- better to let the application fetch the configuration descriptors once, and then pass them to each class driver in turn.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/CDC.c')
-rw-r--r--LUFA/Drivers/USB/Class/Host/CDC.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c
index d648ec23e6..4402f33865 100644
--- a/LUFA/Drivers/USB/Class/Host/CDC.c
+++ b/LUFA/Drivers/USB/Class/Host/CDC.c
@@ -34,24 +34,13 @@
#define INCLUDE_FROM_CDC_CLASS_HOST_C
#include "CDC.h"
-uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint16_t MaxConfigBufferSize)
+uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint16_t ConfigDescriptorSize,
+ uint8_t* ConfigDescriptorData)
{
- uint8_t* ConfigDescriptorData;
- uint16_t ConfigDescriptorSize;
uint8_t FoundEndpoints = 0;
- if (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
- return CDC_ENUMERROR_ControlError;
-
- if (ConfigDescriptorSize > MaxConfigBufferSize)
- return CDC_ENUMERROR_DescriptorTooLarge;
-
- ConfigDescriptorData = alloca(ConfigDescriptorSize);
-
- USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData);
-
if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
- return CDC_ENUMERROR_InvalidConfigDataReturned;
+ return CDC_ENUMERROR_InvalidConfigDescriptor;
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
DComp_CDC_Host_NextCDCControlInterface) != DESCRIPTOR_SEARCH_COMP_Found)