aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/CDCHost/ConfigDescriptor.c
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Host/CDCHost/ConfigDescriptor.c')
-rw-r--r--Demos/Host/CDCHost/ConfigDescriptor.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/Demos/Host/CDCHost/ConfigDescriptor.c b/Demos/Host/CDCHost/ConfigDescriptor.c
index 29afbfaa1..faad3ccd2 100644
--- a/Demos/Host/CDCHost/ConfigDescriptor.c
+++ b/Demos/Host/CDCHost/ConfigDescriptor.c
@@ -70,7 +70,8 @@ uint8_t ProcessConfigurationDescriptor(void)
return InvalidConfigDataReturned;
/* Get the CDC control interface from the configuration descriptor */
- if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextCDCControlInterface))
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextCDCControlInterface) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Descriptor not found, error out */
return NoCDCInterfaceFound;
@@ -81,13 +82,14 @@ uint8_t ProcessConfigurationDescriptor(void)
{
/* Fetch the next bulk or interrupt endpoint from the current CDC interface */
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
- NextInterfaceCDCDataEndpoint))
+ NextInterfaceCDCDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Check to see if the control interface's notification pipe has been found, if so search for the data interface */
if (FoundEndpoints & (1 << CDC_NOTIFICATIONPIPE))
{
/* Get the next CDC data interface from the configuration descriptor (CDC class has two CDC interfaces) */
- if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextCDCDataInterface))
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextCDCDataInterface) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Descriptor not found, error out */
return NoCDCInterfaceFound;
@@ -98,13 +100,17 @@ uint8_t ProcessConfigurationDescriptor(void)
/* Clear the found endpoints mask, since any already processed endpoints aren't in the CDC interface we need */
FoundEndpoints = 0;
- /* Disable any already configured endpoints from the invalid CDC interfaces */
- Endpoint_DisableEndpoint(CDC_NOTIFICATIONPIPE);
- Endpoint_DisableEndpoint(CDC_DATAPIPE_IN);
- Endpoint_DisableEndpoint(CDC_DATAPIPE_OUT);
+ /* Disable any already configured pipes from the invalid CDC interfaces */
+ Pipe_SelectPipe(CDC_NOTIFICATIONPIPE);
+ Pipe_DisablePipe();
+ Pipe_SelectPipe(CDC_DATAPIPE_IN);
+ Pipe_DisablePipe();
+ Pipe_SelectPipe(CDC_DATAPIPE_OUT);
+ Pipe_DisablePipe();
/* Get the next CDC control interface from the configuration descriptor (CDC class has two CDC interfaces) */
- if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextCDCControlInterface))
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextCDCControlInterface) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Descriptor not found, error out */
return NoCDCInterfaceFound;
@@ -113,7 +119,7 @@ uint8_t ProcessConfigurationDescriptor(void)
/* Fetch the next bulk or interrupt endpoint from the current CDC interface */
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
- NextInterfaceCDCDataEndpoint))
+ NextInterfaceCDCDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Descriptor not found, error out */
return NoEndpointFound;