Removed interrupt disable/enable from the Device mode control request processing...
[pub/USBasp.git] / Demos / Host / ClassDriver / CDCHost / CDCHost.c
index b74c394..0cbb771 100644 (file)
@@ -48,11 +48,6 @@ USB_ClassInfo_CDC_Host_t VirtualSerial_CDC_Interface =
                                .DataOUTPipeNumber      = 2,\r
                                .NotificationPipeNumber = 3,\r
                        },\r
-                       \r
-               .State =\r
-                       {\r
-                               // Leave all state values to their defaults                     \r
-                       }\r
        };\r
 \r
        \r
@@ -77,17 +72,10 @@ int main(void)
                                uint16_t ConfigDescriptorSize;\r
                                uint8_t  ConfigDescriptorData[512];\r
 \r
-                               if (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)\r
-                               {\r
-                                       printf("Error Retrieving Device Descriptor.\r\n");\r
-                                       LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
-                                       USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
-                                       break;\r
-                               }\r
-                               \r
-                               if (ConfigDescriptorSize > 512)\r
+                               if ((USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful) ||\r
+                                   (ConfigDescriptorSize > sizeof(ConfigDescriptorData)))\r
                                {\r
-                                       printf("Device Descriptor Too Large To Process.\r\n");\r
+                                       printf("Error Retrieving Configuration Descriptor.\r\n");\r
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
                                        break;\r