diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-05-15 08:02:30 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-05-15 08:02:30 +0000 |
commit | 76d5e99bb8765030a7f99e7b5adf9bae7f92e0ba (patch) | |
tree | 3d21b280a0648adcf2f3d66b9e3fa5c0c00c7f6e /Demos/Host/MouseHostWithParser | |
parent | fabfdd454a11440a5789a70f6476889b02928438 (diff) | |
download | lufa-76d5e99bb8765030a7f99e7b5adf9bae7f92e0ba.tar.gz lufa-76d5e99bb8765030a7f99e7b5adf9bae7f92e0ba.tar.bz2 lufa-76d5e99bb8765030a7f99e7b5adf9bae7f92e0ba.zip |
Fix to previous patch (make CDCHost demo deallocate pipes when an invalid CDC interface is skipped).
Remove the saving of the USB_GetNextDescriptorComp() return value in all host demos, since it went unused anyway; replaced with a simple check against the success error code for clarity.
Diffstat (limited to 'Demos/Host/MouseHostWithParser')
-rw-r--r-- | Demos/Host/MouseHostWithParser/ConfigDescriptor.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Demos/Host/MouseHostWithParser/ConfigDescriptor.c b/Demos/Host/MouseHostWithParser/ConfigDescriptor.c index 486a0c7fb..c00852372 100644 --- a/Demos/Host/MouseHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/MouseHostWithParser/ConfigDescriptor.c @@ -49,7 +49,6 @@ uint8_t ProcessConfigurationDescriptor(void) {
uint8_t* ConfigDescriptorData;
uint16_t ConfigDescriptorSize;
- uint8_t ErrorCode;
/* Get Configuration Descriptor size from the device */
if (USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
@@ -70,14 +69,16 @@ uint8_t ProcessConfigurationDescriptor(void) return InvalidConfigDataReturned;
/* Get the mouse interface from the configuration descriptor */
- if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextMouseInterface)))
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextMouseInterface) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Descriptor not found, error out */
return NoHIDInterfaceFound;
}
/* Get the mouse interface's HID descriptor */
- if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextHID)))
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextHID) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Descriptor not found, error out */
return NoHIDDescriptorFound;
@@ -87,8 +88,8 @@ uint8_t ProcessConfigurationDescriptor(void) HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_HID_t).HIDReportLength;
/* Get the mouse interface's data endpoint descriptor */
- if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
- NextInterfaceMouseDataEndpoint)))
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceMouseDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Descriptor not found, error out */
return NoEndpointFound;
|