+ USB_DeviceState = DEVICE_STATE_Unattached;\r
+ USB_Device_ConfigurationNumber = 0;\r
+\r
+ #if !defined(NO_DEVICE_REMOTE_WAKEUP)\r
+ USB_Device_RemoteWakeupEnabled = false;\r
+ #endif\r
+\r
+ #if !defined(NO_DEVICE_SELF_POWER)\r
+ USB_Device_CurrentlySelfPowered = false;\r
+ #endif\r
+\r
+ #if !defined(FIXED_CONTROL_ENDPOINT_SIZE)\r
+ USB_Descriptor_Device_t* DeviceDescriptorPtr;\r
+ \r
+ #if defined(ARCH_HAS_MULTI_ADDRESS_SPACE) && \\r
+ !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))\r
+ uint8_t DescriptorAddressSpace;\r
+\r
+ if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr, &DescriptorAddressSpace) != NO_DESCRIPTOR)\r
+ {\r
+ if (DescriptorAddressSpace == MEMSPACE_FLASH)\r
+ USB_Device_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
+ else if (DescriptorAddressSpace == MEMSPACE_EEPROM)\r
+ USB_Device_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
+ else\r
+ USB_Device_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;\r
+ }\r
+ #else\r
+ if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr) != NO_DESCRIPTOR)\r
+ {\r
+ #if defined(USE_RAM_DESCRIPTORS)\r
+ USB_Device_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;\r
+ #elif defined(USE_EEPROM_DESCRIPTORS)\r
+ USB_Device_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
+ #else\r
+ USB_Device_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
+ #endif\r
+ } \r
+ #endif\r
+ #endif\r
+\r
+ if (USB_Options & USB_DEVICE_OPT_LOWSPEED)\r
+ USB_Device_SetLowSpeed();\r
+ else\r
+ USB_Device_SetFullSpeed();\r
+\r
+ Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,\r
+ ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize,\r
+ ENDPOINT_BANK_SINGLE);\r
+\r
+ USB_Attach();\r