@ -70,7 +70,8 @@ uint8_t ProcessConfigurationDescriptor(void)
return InvalidConfigDataReturned ;
return InvalidConfigDataReturned ;
/* Get the CDC control interface from the configuration descriptor */
/* 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 */
/* Descriptor not found, error out */
return NoCDCInterfaceFound ;
return NoCDCInterfaceFound ;
@ -81,13 +82,14 @@ uint8_t ProcessConfigurationDescriptor(void)
{
{
/* Fetch the next bulk or interrupt endpoint from the current CDC interface */
/* Fetch the next bulk or interrupt endpoint from the current CDC interface */
if ( USB_GetNextDescriptorComp ( & ConfigDescriptorSize , & ConfigDescriptorData ,
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 */
/* 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 ) )
if ( FoundEndpoints & ( 1 < < CDC_NOTIFICATIONPIPE ) )
{
{
/* Get the next CDC data interface from the configuration descriptor (CDC class has two CDC interfaces) */
/* 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 */
/* Descriptor not found, error out */
return NoCDCInterfaceFound ;
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 */
/* Clear the found endpoints mask, since any already processed endpoints aren't in the CDC interface we need */
FoundEndpoints = 0 ;
FoundEndpoints = 0 ;
/* Disable any already configured endpoints from the invalid CDC interfaces */
/* Disable any already configured pipes from the invalid CDC interfaces */
Endpoint_DisableEndpoint ( CDC_NOTIFICATIONPIPE ) ;
Pipe_SelectPipe ( CDC_NOTIFICATIONPIPE ) ;
Endpoint_DisableEndpoint ( CDC_DATAPIPE_IN ) ;
Pipe_DisablePipe ( ) ;
Endpoint_DisableEndpoint ( CDC_DATAPIPE_OUT ) ;
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) */
/* 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 */
/* Descriptor not found, error out */
return NoCDCInterfaceFound ;
return NoCDCInterfaceFound ;
@ -113,7 +119,7 @@ uint8_t ProcessConfigurationDescriptor(void)
/* Fetch the next bulk or interrupt endpoint from the current CDC interface */
/* Fetch the next bulk or interrupt endpoint from the current CDC interface */
if ( USB_GetNextDescriptorComp ( & ConfigDescriptorSize , & ConfigDescriptorData ,
if ( USB_GetNextDescriptorComp ( & ConfigDescriptorSize , & ConfigDescriptorData ,
NextInterfaceCDCDataEndpoint ) )
NextInterfaceCDCDataEndpoint ) ! = DESCRIPTOR_SEARCH_COMP_Found )
{
{
/* Descriptor not found, error out */
/* Descriptor not found, error out */
return NoEndpointFound ;
return NoEndpointFound ;