#endif\r
#if !defined(CONTROL_ONLY_DEVICE)\r
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):\r
- Endpoint_SelectEndpoint(USB_ControlRequest.wIndex & 0xFF);\r
+ Endpoint_SelectEndpoint((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK);\r
\r
CurrentStatus = Endpoint_IsStalled();\r
\r
}\r
\r
static void USB_Device_ClearSetFeature(void)\r
-{ \r
+{\r
switch (USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT)\r
{\r
#if !defined(NO_DEVICE_REMOTE_WAKEUP) \r
\r
Endpoint_SelectEndpoint(EndpointIndex);\r
\r
- if (Endpoint_IsEnabled())\r
- { \r
- if (USB_ControlRequest.bRequest == REQ_SetFeature)\r
- {\r
- Endpoint_StallTransaction();\r
- }\r
- else\r
- {\r
- Endpoint_ClearStall();\r
- Endpoint_ResetFIFO(EndpointIndex);\r
- Endpoint_ResetDataToggle();\r
- } \r
+ if (!(Endpoint_IsEnabled()))\r
+ return;\r
+\r
+ if (USB_ControlRequest.bRequest == REQ_SetFeature)\r
+ {\r
+ Endpoint_StallTransaction();\r
+ }\r
+ else\r
+ {\r
+ Endpoint_ClearStall();\r
+ Endpoint_ResetFIFO(EndpointIndex);\r
+ Endpoint_ResetDataToggle();\r
}\r
}\r
\r