diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-31 07:48:32 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-31 07:48:32 +0000 |
commit | 7fbb75928749b74a0964ad159159066967191243 (patch) | |
tree | ac8533e4dcd4853c6a6f55f08a2e01d73ae3bf72 /Demos/Host/ClassDriver/CDCHost/CDCHost.c | |
parent | 813e6f0318090135c652eb7348b154576faa680c (diff) | |
download | lufa-7fbb75928749b74a0964ad159159066967191243.tar.gz lufa-7fbb75928749b74a0964ad159159066967191243.tar.bz2 lufa-7fbb75928749b74a0964ad159159066967191243.zip |
Changed the parameters and behaviour of the USB_GetDeviceConfigDescriptor() function so that it now performs size checks and data validations internally, to simplify user code.
Diffstat (limited to 'Demos/Host/ClassDriver/CDCHost/CDCHost.c')
-rw-r--r-- | Demos/Host/ClassDriver/CDCHost/CDCHost.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Demos/Host/ClassDriver/CDCHost/CDCHost.c b/Demos/Host/ClassDriver/CDCHost/CDCHost.c index 7aa8deeee..4f67f3fbe 100644 --- a/Demos/Host/ClassDriver/CDCHost/CDCHost.c +++ b/Demos/Host/ClassDriver/CDCHost/CDCHost.c @@ -72,9 +72,8 @@ int main(void) uint16_t ConfigDescriptorSize;
uint8_t ConfigDescriptorData[512];
- if ((USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful) ||
- (ConfigDescriptorSize > sizeof(ConfigDescriptorData)) ||
- (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData)))
+ if (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData,
+ sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful)
{
printf("Error Retrieving Configuration Descriptor.\r\n");
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|