\r
if (USB_DeviceState == DEVICE_STATE_Unattached)\r
return ENDPOINT_RWCSTREAM_DeviceDisconnected;\r
+ else if (USB_DeviceState == DEVICE_STATE_Suspended)\r
+ return ENDPOINT_RWCSTREAM_BusSuspended;\r
\r
if (Endpoint_IsINReady())\r
{\r
- while (Length && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))\r
+ uint8_t BytesInEndpoint = Endpoint_BytesInEndpoint();\r
+ \r
+ while (Length && (BytesInEndpoint < USB_ControlEndpointSize))\r
{\r
TEMPLATE_TRANSFER_BYTE(DataStream);\r
Length--;\r
+ BytesInEndpoint++;\r
}\r
\r
- LastPacketFull = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);\r
+ LastPacketFull = (BytesInEndpoint == USB_ControlEndpointSize);\r
Endpoint_ClearIN();\r
}\r
}\r
while (!(Endpoint_IsOUTReceived()))\r
{\r
if (USB_DeviceState == DEVICE_STATE_Unattached)\r
- return ENDPOINT_RWCSTREAM_DeviceDisconnected; \r
+ return ENDPOINT_RWCSTREAM_DeviceDisconnected;\r
+ else if (USB_DeviceState == DEVICE_STATE_Suspended)\r
+ return ENDPOINT_RWCSTREAM_BusSuspended;\r
}\r
\r
return ENDPOINT_RWCSTREAM_NoError;\r