aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-11-01 06:05:54 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-11-01 06:05:54 +0000
commitcb7f7a8241e5eb4fab9ed3c7f0a6c0600f6d43fb (patch)
tree82ac7b631ef92417078bed876472c9ed003e90c6 /LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
parent139c1afeeb8d76595fbe386ed3d7d394583d6b30 (diff)
downloadlufa-cb7f7a8241e5eb4fab9ed3c7f0a6c0600f6d43fb.tar.gz
lufa-cb7f7a8241e5eb4fab9ed3c7f0a6c0600f6d43fb.tar.bz2
lufa-cb7f7a8241e5eb4fab9ed3c7f0a6c0600f6d43fb.zip
Fix XMEGA core USB driver endpoint code to prevent incorrect STALL determination.
Diffstat (limited to 'LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h')
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
index 62398762c..49bc1f2f6 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
+++ b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
@@ -289,7 +289,7 @@
const uint16_t Size,
const uint8_t Banks)
{
- uint8_t EPConfigMask = (Banks | Endpoint_BytesToEPSizeMask(Size));
+ uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | Banks | Endpoint_BytesToEPSizeMask(Size));
switch (Type)
{
@@ -345,7 +345,10 @@
static inline void Endpoint_ResetEndpoint(const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE;
static inline void Endpoint_ResetEndpoint(const uint8_t EndpointNumber)
{
- USB_Endpoint_SelectedFIFO->Position = 0;
+ if (EndpointNumber & ENDPOINT_DIR_IN)
+ USB_Endpoint_FIFOs[EndpointNumber & ENDPOINT_EPNUM_MASK].IN.Position = 0;
+ else
+ USB_Endpoint_FIFOs[EndpointNumber & ENDPOINT_EPNUM_MASK].OUT.Position = 0;
}
/** Determines if the currently selected endpoint is enabled, but not necessarily configured.
@@ -564,7 +567,7 @@
static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline bool Endpoint_IsStalled(void)
{
- return ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_STALLF_bm) ? true : false);
+ return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_STALLF_bm) ? true : false);
}
/** Resets the data toggle of the currently selected endpoint. */