aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Core/XMEGA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-07-19 02:42:27 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-07-19 02:42:27 +0000
commit2c404e5af53409af5ce279321377a1303c776617 (patch)
tree090bca3a20578720326ef0102cf1b22f582adf52 /LUFA/Drivers/USB/Core/XMEGA
parent69243c5071c4b059c1405f9dd4753f306f8dc04e (diff)
downloadlufa-2c404e5af53409af5ce279321377a1303c776617.tar.gz
lufa-2c404e5af53409af5ce279321377a1303c776617.tar.bz2
lufa-2c404e5af53409af5ce279321377a1303c776617.zip
Add support for the ORDERED_EP_CONFIG compile time token on the UC3 architecture.
Diffstat (limited to 'LUFA/Drivers/USB/Core/XMEGA')
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h53
1 files changed, 18 insertions, 35 deletions
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
index 14ebf01f2..8a679f532 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
+++ b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h
@@ -283,7 +283,24 @@
const uint8_t Banks)
{
Endpoint_SelectEndpoint(Number | Direction);
- Endpoint_SelectedEndpointHandle->CTRL = (Type | Banks | Endpoint_BytesToEPSizeMask(Size));
+
+ uint8_t EPTypeMask = 0;
+ switch (Type)
+ {
+ case USB_EPTYPE_Control:
+ EPTypeMask = USB_EP_TYPE_CONTROL_gc;
+ break;
+ case USB_EPTYPE_Isochronous:
+ EPTypeMask = USB_EP_TYPE_ISOCHRONOUS_gc;
+ break;
+ default:
+ EPTypeMask = USB_EP_TYPE_BULK_gc;
+ break;
+ }
+
+ Endpoint_SelectedEndpointHandle->CTRL = 0;
+ Endpoint_SelectedEndpointHandle->STATUS = (USB_EP_BUSNACK0_bm | USB_EP_BUSNACK1_bm);
+ Endpoint_SelectedEndpointHandle->CTRL = (EPTypeMask | Banks | Endpoint_BytesToEPSizeMask(Size));
return true;
}
@@ -324,27 +341,7 @@
{
// TODO
}
-#if 0
- /** Enables the currently selected endpoint so that data can be sent and received through it to
- * and from a host.
- *
- * \note Endpoints must first be configured properly via \ref Endpoint_ConfigureEndpoint().
- */
- static inline void Endpoint_EnableEndpoint(void) ATTR_ALWAYS_INLINE;
- static inline void Endpoint_EnableEndpoint(void)
- {
- // TODO
- }
- /** Disables the currently selected endpoint so that data cannot be sent and received through it
- * to and from a host.
- */
- static inline void Endpoint_DisableEndpoint(void) ATTR_ALWAYS_INLINE;
- static inline void Endpoint_DisableEndpoint(void)
- {
- // TODO
- }
-#endif
/** Determines if the currently selected endpoint is enabled, but not necessarily configured.
*
* \return Boolean \c true if the currently selected endpoint is enabled, \c false otherwise.
@@ -355,20 +352,6 @@
return true;
}
- /** Retrieves the number of busy banks in the currently selected endpoint, which have been queued for
- * transmission via the \ref Endpoint_ClearIN() command, or are awaiting acknowledgement via the
- * \ref Endpoint_ClearOUT() command.
- *
- * \ingroup Group_EndpointPacketManagement_XMEGA
- *
- * \return Total number of busy banks in the selected endpoint.
- */
- static inline uint8_t Endpoint_GetBusyBanks(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
- static inline uint8_t Endpoint_GetBusyBanks(void)
- {
- return 0; // TODO
- }
-
/** Aborts all pending IN transactions on the currently selected endpoint, once the bank
* has been queued for transmission to the host via \ref Endpoint_ClearIN(). This function
* will terminate all queued transactions, resetting the endpoint banks ready for a new