Extend USB_GetDeviceConfigDescriptor() routine to require the configuration number within the device to fetch, to add support for multi-configuration devices.

This commit is contained in:
Dean Camera committed 2009-06-19 03:37:47 +00:00
1 parent 0d8679cf6b
commit dfa547164a
17 files changed
+49 -40

No files matched your search

@@ -51,7 +51,7 @@ uint8_t ProcessConfigurationDescriptor(void)
uint16_t ConfigDescriptorSize;
/* Get Configuration Descriptor size from the device */
if (USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
if (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
return ControlError;
/* Ensure that the Configuration Descriptor isn't too large */
@@ -62,7 +62,7 @@ uint8_t ProcessConfigurationDescriptor(void)
ConfigDescriptorData = alloca(ConfigDescriptorSize);
/* Retrieve the entire configuration descriptor into the allocated buffer */
USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);
USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData);
/* Validate returned data - ensure first entry is a configuration header descriptor */
if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)