diff options
Diffstat (limited to 'at91lib/usb/device/core')
-rw-r--r-- | at91lib/usb/device/core/USBDDriver.c | 8 | ||||
-rw-r--r-- | at91lib/usb/device/core/USBDDriverDescriptors.h | 10 |
2 files changed, 10 insertions, 8 deletions
diff --git a/at91lib/usb/device/core/USBDDriver.c b/at91lib/usb/device/core/USBDDriver.c index 83cbd9e..f84f6c6 100644 --- a/at91lib/usb/device/core/USBDDriver.c +++ b/at91lib/usb/device/core/USBDDriver.c @@ -58,9 +58,9 @@ static const USBConfigurationDescriptor *GetCurConfigDesc(USBDDriver *pDriver) // Use different descriptor depending on device speed
if (USBD_IsHighSpeed())
- return &pDriver->pDescriptors->pHsConfiguration[cfgidx];
+ return pDriver->pDescriptors->pHsConfiguration[cfgidx];
else
- return &pDriver->pDescriptors->pFsConfiguration[cfgidx];
+ return pDriver->pDescriptors->pFsConfiguration[cfgidx];
}
static const USBConfigurationDescriptor *GetCurOtherSpeedDesc(USBDDriver *pDriver)
@@ -72,9 +72,9 @@ static const USBConfigurationDescriptor *GetCurOtherSpeedDesc(USBDDriver *pDrive // Use different descriptor depending on device speed
if (USBD_IsHighSpeed())
- return &pDriver->pDescriptors->pHsOtherSpeed[cfgidx];
+ return pDriver->pDescriptors->pHsOtherSpeed[cfgidx];
else
- return &pDriver->pDescriptors->pFsOtherSpeed[cfgidx];
+ return pDriver->pDescriptors->pFsOtherSpeed[cfgidx];
}
diff --git a/at91lib/usb/device/core/USBDDriverDescriptors.h b/at91lib/usb/device/core/USBDDriverDescriptors.h index f1064e4..29e5eb7 100644 --- a/at91lib/usb/device/core/USBDDriverDescriptors.h +++ b/at91lib/usb/device/core/USBDDriverDescriptors.h @@ -47,6 +47,8 @@ #include <usb/common/core/USBConfigurationDescriptor.h>
#include <usb/common/core/USBDeviceQualifierDescriptor.h>
+#define USBD_NUM_CONFIGS 4
+
//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------
@@ -62,19 +64,19 @@ typedef struct { /// Pointer to the full-speed device descriptor.
const USBDeviceDescriptor *pFsDevice;
/// Pointer to the full-speed configuration descriptor.
- const USBConfigurationDescriptor *pFsConfiguration;
+ const USBConfigurationDescriptor *pFsConfiguration[USBD_NUM_CONFIGS];
/// Pointer to the full-speed qualifier descriptor.
const USBDeviceQualifierDescriptor *pFsQualifier;
/// Pointer to the full-speed other speed configuration descriptor.
- const USBConfigurationDescriptor *pFsOtherSpeed;
+ const USBConfigurationDescriptor *pFsOtherSpeed[USBD_NUM_CONFIGS];
/// Pointer to the high-speed device descriptor.
const USBDeviceDescriptor *pHsDevice;
/// Pointer to the high-speed configuration descriptor.
- const USBConfigurationDescriptor *pHsConfiguration;
+ const USBConfigurationDescriptor *pHsConfiguration[USBD_NUM_CONFIGS];
/// Pointer to the high-speed qualifier descriptor.
const USBDeviceQualifierDescriptor *pHsQualifier;
/// Pointer to the high-speed other speed configuration descriptor.
- const USBConfigurationDescriptor *pHsOtherSpeed;
+ const USBConfigurationDescriptor *pHsOtherSpeed[USBD_NUM_CONFIGS];
/// Pointer to the list of string descriptors.
const unsigned char **pStrings;
/// Number of string descriptors in list.
|