Add support for the Atmel XMEGA A3BU Xplained board.
[pub/USBasp.git] / LUFA / Drivers / USB / Core / XMEGA / Endpoint_XMEGA.c
index 604427f..ead993e 100644 (file)
@@ -107,8 +107,16 @@ uint8_t Endpoint_WaitUntilReady(void)
 
        for (;;)
        {
-               if (Endpoint_IsOUTReceived())
-                 return ENDPOINT_READYWAIT_NoError;
+               if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN)
+               {
+                       if (Endpoint_IsINReady())
+                         return ENDPOINT_READYWAIT_NoError;
+               }
+               else
+               {
+                       if (Endpoint_IsOUTReceived())
+                         return ENDPOINT_READYWAIT_NoError;
+               }
                
                uint8_t USB_DeviceState_LCL = USB_DeviceState;