- bool SendZLP = true;\r
- \r
- if (!(USB_GetOSFeatureDescriptor(wValue, wIndex, &DescriptorPointer, &DescriptorSize)))\r
- return;\r
-\r
- Endpoint_ClearSetupReceived();\r
- \r
- if (wLength > DescriptorSize)\r
- wLength = DescriptorSize;\r
- \r
- while (wLength && (!(Endpoint_IsSetupOUTReceived())))\r
- {\r
- while (!(Endpoint_IsSetupINReady()));\r
- \r
- while (wLength && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))\r
- {\r
- #if defined(USE_RAM_DESCRIPTORS)\r
- Endpoint_Write_Byte(*((uint8_t*)DescriptorPointer++));\r
- #elif defined (USE_EEPROM_DESCRIPTORS)\r
- Endpoint_Write_Byte(eeprom_read_byte(DescriptorPointer++)); \r
- #else\r
- Endpoint_Write_Byte(pgm_read_byte(DescriptorPointer++));\r
- #endif\r
- \r
- wLength--;\r
- }\r
- \r
- SendZLP = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);\r
- Endpoint_ClearSetupIN();\r
- }\r
- \r
- if (Endpoint_IsSetupOUTReceived())\r
+ if (!(USB_GetOSFeatureDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,\r
+ &DescriptorPointer, &DescriptorSize)))\r