\r
while (Length)\r
{\r
+ if (Endpoint_IsSETUPReceived())\r
+ return ENDPOINT_RWCSTREAM_HostAborted;\r
+\r
+ if (USB_DeviceState == DEVICE_STATE_Unattached)\r
+ return ENDPOINT_RWCSTREAM_DeviceDisconnected;\r
+ \r
if (Endpoint_IsOUTReceived())\r
{\r
while (Length && Endpoint_BytesInEndpoint())\r
}\r
\r
Endpoint_ClearOUT();\r
- }\r
-\r
- if (USB_DeviceState == DEVICE_STATE_Unattached)\r
- return ENDPOINT_RWCSTREAM_DeviceDisconnected;\r
+ } \r
}\r
\r
while (!(Endpoint_IsINReady()))\r