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
|
@ -49,7 +49,6 @@ uint8_t ProcessConfigurationDescriptor(void)
|
|||
{
|
||||
uint8_t* ConfigDescriptorData;
|
||||
uint16_t ConfigDescriptorSize;
|
||||
uint8_t ErrorCode;
|
||||
uint8_t FoundEndpoints = 0;
|
||||
|
||||
/* Get Configuration Descriptor size from the device */
|
||||
|
@ -71,8 +70,8 @@ uint8_t ProcessConfigurationDescriptor(void)
|
|||
return InvalidConfigDataReturned;
|
||||
|
||||
/* Get the mass storage interface from the configuration descriptor */
|
||||
if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
|
||||
NextMassStorageInterface)))
|
||||
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
|
||||
NextMassStorageInterface) != DESCRIPTOR_SEARCH_COMP_Found)
|
||||
{
|
||||
/* Descriptor not found, error out */
|
||||
return NoInterfaceFound;
|
||||
|
@ -82,8 +81,8 @@ uint8_t ProcessConfigurationDescriptor(void)
|
|||
while (FoundEndpoints != ((1 << MASS_STORE_DATA_IN_PIPE) | (1 << MASS_STORE_DATA_OUT_PIPE)))
|
||||
{
|
||||
/* Fetch the next bulk endpoint from the current mass storage interface */
|
||||
if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
|
||||
NextInterfaceBulkDataEndpoint)))
|
||||
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
|
||||
NextInterfaceBulkDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
|
||||
{
|
||||
/* Descriptor not found, error out */
|
||||
return NoEndpointFound;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue