{\r
Endpoint_ClearSETUP();\r
\r
- while (!(Endpoint_IsINReady()));\r
- \r
Endpoint_ClearIN();\r
\r
while (!(Endpoint_IsINReady()));\r
\r
static void USB_Device_SetConfiguration(void)\r
{\r
- bool AlreadyConfigured = (USB_ConfigurationNumber != 0);\r
+ bool AlreadyConfigured = (USB_ConfigurationNumber != 0);\r
\r
#if defined(USE_SINGLE_DEVICE_CONFIGURATION)\r
if ((uint8_t)USB_ControlRequest.wValue > 1)\r
\r
void USB_Device_GetConfiguration(void)\r
{\r
- Endpoint_ClearSETUP(); \r
+ Endpoint_ClearSETUP();\r
\r
Endpoint_Write_Byte(USB_ConfigurationNumber);\r
\r
#if defined(USE_RAM_DESCRIPTORS)\r
Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize);\r
#else\r
- bool SendZLP;\r
+ bool SendZLP;\r
\r
if (USB_ControlRequest.wLength > DescriptorSize)\r
USB_ControlRequest.wLength = DescriptorSize;\r
case REQREC_DEVICE:\r
if ((uint8_t)USB_ControlRequest.wValue == FEATURE_REMOTE_WAKEUP)\r
USB_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature);\r
+ else\r
+ return;\r
\r
break; \r
#if !defined(CONTROL_ONLY_DEVICE)\r
{\r
uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);\r
\r
- if (EndpointIndex != ENDPOINT_CONTROLEP)\r
- {\r
- Endpoint_SelectEndpoint(EndpointIndex);\r
-\r
- if (Endpoint_IsEnabled())\r
- { \r
- if (USB_ControlRequest.bRequest == REQ_ClearFeature)\r
- {\r
- Endpoint_ClearStall();\r
- Endpoint_ResetFIFO(EndpointIndex);\r
- Endpoint_ResetDataToggle();\r
- }\r
- else\r
- {\r
- Endpoint_StallTransaction(); \r
- }\r
+ if (EndpointIndex == ENDPOINT_CONTROLEP)\r
+ return;\r
+\r
+ Endpoint_SelectEndpoint(EndpointIndex);\r
+\r
+ if (Endpoint_IsEnabled())\r
+ { \r
+ if (USB_ControlRequest.bRequest == REQ_ClearFeature)\r
+ {\r
+ Endpoint_ClearStall();\r
+ Endpoint_ResetFIFO(EndpointIndex);\r
+ Endpoint_ResetDataToggle();\r
+ }\r
+ else\r
+ {\r
+ Endpoint_StallTransaction();\r
}\r
-\r
- Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
- Endpoint_ClearSETUP();\r
- Endpoint_ClearIN();\r
}\r
}\r
\r
break;\r
#endif\r
}\r
+\r
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
+\r
+ Endpoint_ClearSETUP();\r
+\r
+ Endpoint_ClearIN();\r
}\r
\r
#endif\r