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.
This commit is contained in:
parent
fabfdd454a
commit
76d5e99bb8
9 changed files with 46 additions and 34 deletions
|
@ -71,7 +71,8 @@ uint8_t ProcessConfigurationDescriptor(void)
|
|||
return InvalidConfigDataReturned;
|
||||
|
||||
/* Get the HID interface from the configuration descriptor */
|
||||
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextHIDInterface))
|
||||
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
|
||||
NextHIDInterface) != DESCRIPTOR_SEARCH_COMP_Found)
|
||||
{
|
||||
/* Descriptor not found, error out */
|
||||
return NoHIDInterfaceFound;
|
||||
|
@ -80,7 +81,8 @@ uint8_t ProcessConfigurationDescriptor(void)
|
|||
while (FoundEndpoints != ((1 << HID_DATA_IN_PIPE) | (1 << HID_DATA_OUT_PIPE)))
|
||||
{
|
||||
/* Get the next HID interface's data endpoint descriptor */
|
||||
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextInterfaceHIDDataEndpoint))
|
||||
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
|
||||
NextInterfaceHIDDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
|
||||
{
|
||||
/* Not all HID devices have an OUT endpoint - if we've reached the end of the HID descriptor
|
||||
* but only found the mandatory IN endpoint, it's safe to continue with the device enumeration */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue