Fixed incorrect comparison in the descriptor callback routine of the TeensyHID bootlo...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Template / Template_Endpoint_Control_W.c
index 70560cf..8a5be11 100644 (file)
@@ -18,10 +18,12 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint16_t Length)
                \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
-                       uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint();\r
+                       uint8_t BytesInEndpoint = Endpoint_BytesInEndpoint();\r
                \r
                        while (Length && (BytesInEndpoint < USB_ControlEndpointSize))\r
                        {\r
@@ -38,7 +40,9 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint16_t Length)
        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