aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Core/XMEGA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-10-31 03:31:00 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-10-31 03:31:00 +0000
commit00ad5090614568f75b588d5fe3480f4d20d370b2 (patch)
tree57f98f73a6dc1fef515bd1717bce140695cd858a /LUFA/Drivers/USB/Core/XMEGA
parent0304916356ea83bb17783df157c79cbfdef0d45b (diff)
downloadlufa-00ad5090614568f75b588d5fe3480f4d20d370b2.tar.gz
lufa-00ad5090614568f75b588d5fe3480f4d20d370b2.tar.bz2
lufa-00ad5090614568f75b588d5fe3480f4d20d370b2.zip
Add support for the Atmel XMEGA A3BU Xplained board.
More XMEGA USB core fixes.
Diffstat (limited to 'LUFA/Drivers/USB/Core/XMEGA')
-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.