Fixed CDCHost not clearing configured endpoints and resetting configured endpoints...
authorDean Camera <dean@fourwalledcubicle.com>
Fri, 15 May 2009 07:38:35 +0000 (07:38 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Fri, 15 May 2009 07:38:35 +0000 (07:38 +0000)
Demos/Device/RNDISEthernet/RNDISEthernet.c
Demos/Host/CDCHost/ConfigDescriptor.c
LUFA/ChangeLog.txt

index 96fef39..fd88ecf 100644 (file)
@@ -113,10 +113,6 @@ EVENT_HANDLER(USB_Disconnect)
 EVENT_HANDLER(USB_ConfigurationChanged)\r
 {\r
        /* Setup CDC Notification, Rx and Tx Endpoints */\r
-       Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,\r
-                                      ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,\r
-                                  ENDPOINT_BANK_SINGLE);\r
-\r
        Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,\r
                                       ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,\r
                                   ENDPOINT_BANK_SINGLE);\r
@@ -125,6 +121,10 @@ EVENT_HANDLER(USB_ConfigurationChanged)
                                       ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,\r
                                   ENDPOINT_BANK_SINGLE);\r
 \r
+       Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,\r
+                                      ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,\r
+                                  ENDPOINT_BANK_SINGLE);\r
+\r
        /* Indicate USB connected and ready */\r
        UpdateStatus(Status_USBReady);\r
 \r
index 9a23fc3..29afbfa 100644 (file)
@@ -95,6 +95,14 @@ uint8_t ProcessConfigurationDescriptor(void)
                        }\r
                        else\r
                        {\r
+                               /* Clear the found endpoints mask, since any already processed endpoints aren't in the CDC interface we need */\r
+                               FoundEndpoints = 0;\r
+\r
+                               /* Disable any already configured endpoints from the invalid CDC interfaces */\r
+                               Endpoint_DisableEndpoint(CDC_NOTIFICATIONPIPE);\r
+                               Endpoint_DisableEndpoint(CDC_DATAPIPE_IN);\r
+                               Endpoint_DisableEndpoint(CDC_DATAPIPE_OUT);\r
+                       \r
                                /* Get the next CDC control interface from the configuration descriptor (CDC class has two CDC interfaces) */\r
                                if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextCDCControlInterface))\r
                                {\r
index be15e73..69a60f1 100644 (file)
@@ -15,6 +15,8 @@
   *  - Removed support for endpoint/pipe non-control interrupts; these did not act in the way users expected, and had many subtle issues\r
   *  - Fixed Device Mode not handling Set Feature and Clear Feature Chapter 9 requests that are addressed to the device (thanks to Brian Dickman)\r
   *  - Moved control endpoint interrupt handling into the library itself, enable via the new INTERRUPT_CONTROL_ENDPOINT token\r
+  *  - Fixed CDCHost not clearing configured endpoints and resetting configured endpoints mask when a partially enumerated invalid CDC\r
+  *    interface is skipped\r
   *\r
   *\r
   *  \section Sec_ChangeLog090510 Version 090510\r