aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Core
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers/USB/Core')
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c12
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h6
2 files changed, 13 insertions, 5 deletions
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c
index 604427fca..ead993ebb 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c
+++ b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c
@@ -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;
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
index 2ba135619..62398762c 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
+++ b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
@@ -305,7 +305,7 @@
}
if (Type == EP_TYPE_CONTROL)
- Endpoint_ConfigureEndpoint_PRV(Number, Direction ^ ENDPOINT_DIR_IN, EPConfigMask, Size);
+ Endpoint_ConfigureEndpoint_PRV(Number, (Direction ^ ENDPOINT_DIR_IN), EPConfigMask, Size);
return Endpoint_ConfigureEndpoint_PRV(Number, Direction, EPConfigMask, Size);
}
@@ -367,7 +367,7 @@
*/
static inline void Endpoint_AbortPendingIN(void)
{
- // TODO
+ USB_Endpoint_SelectedHandle->STATUS |= USB_EP_BUSNACK0_bm;
}
/** Determines if the currently selected endpoint may be read from (if data is waiting in the endpoint
@@ -581,7 +581,7 @@
static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetEndpointDirection(void)
{
- return ((USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN) ? true : false);
+ return (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN);
}
/** Sets the direction of the currently selected endpoint.