diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-07-19 02:42:27 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-07-19 02:42:27 +0000 |
| commit | 36d0d5949b434e7a21da10192ad5ffdf3eb36368 (patch) | |
| tree | 090bca3a20578720326ef0102cf1b22f582adf52 /LUFA/Drivers/USB/Core/XMEGA | |
| parent | cb3305fa8b746a3ccb6cc779a2af07e44c289e75 (diff) | |
Add support for the ORDERED_EP_CONFIG compile time token on the UC3 architecture.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1893 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB/Core/XMEGA')
| -rw-r--r-- | LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h | 53 |
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 14ebf01f..8a679f53 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 |
