diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2013-01-27 19:35:40 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2013-01-27 19:35:40 +0000 |
commit | fb18c315d02303e3f32fda41fcde3b16e747f10b (patch) | |
tree | f828d9d8f650227710daacc502a3c8a41c61f199 | |
parent | f8f8ac0b1a4745da8e5311ddb0bd395b7dd18ba8 (diff) | |
download | lufa-fb18c315d02303e3f32fda41fcde3b16e747f10b.tar.gz lufa-fb18c315d02303e3f32fda41fcde3b16e747f10b.tar.bz2 lufa-fb18c315d02303e3f32fda41fcde3b16e747f10b.zip |
Fix broken XMEGA USB support.
-rw-r--r-- | LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h | 4 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/DeviceStandardReq.c | 2 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/UC3/Device_UC3.h | 4 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h | 8 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h | 9 |
5 files changed, 17 insertions, 10 deletions
diff --git a/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h b/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h index 787469026..a2a2ddf0e 100644 --- a/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h +++ b/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h @@ -213,8 +213,8 @@ UDADDR = (UDADDR & (1 << ADDEN)) | (Address & 0x7F); } - static inline void USB_Device_EnableDeviceAddress(void) ATTR_ALWAYS_INLINE; - static inline void USB_Device_EnableDeviceAddress(void) + static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE; + static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) { UDADDR |= (1 << ADDEN); } diff --git a/LUFA/Drivers/USB/Core/DeviceStandardReq.c b/LUFA/Drivers/USB/Core/DeviceStandardReq.c index 6284dd389..3176e15bc 100644 --- a/LUFA/Drivers/USB/Core/DeviceStandardReq.c +++ b/LUFA/Drivers/USB/Core/DeviceStandardReq.c @@ -134,7 +134,7 @@ static void USB_Device_SetAddress(void) while (!(Endpoint_IsINReady())); - USB_Device_EnableDeviceAddress(); + USB_Device_EnableDeviceAddress(DeviceAddress); USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; } diff --git a/LUFA/Drivers/USB/Core/UC3/Device_UC3.h b/LUFA/Drivers/USB/Core/UC3/Device_UC3.h index 86583d8f3..60a1e27a8 100644 --- a/LUFA/Drivers/USB/Core/UC3/Device_UC3.h +++ b/LUFA/Drivers/USB/Core/UC3/Device_UC3.h @@ -211,8 +211,8 @@ AVR32_USBB.UDCON.uadd = Address; } - static inline void USB_Device_EnableDeviceAddress(void) ATTR_ALWAYS_INLINE; - static inline void USB_Device_EnableDeviceAddress(void) + static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE; + static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) { AVR32_USBB.UDCON.adden = true; } diff --git a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h index d2d506cd7..6e2380a17 100644 --- a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h +++ b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h @@ -205,13 +205,13 @@ static inline void USB_Device_SetDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE; static inline void USB_Device_SetDeviceAddress(const uint8_t Address) { - USB.ADDR = Address; + /* No implementation for XMEGA architecture */ } - static inline void USB_Device_EnableDeviceAddress(void) ATTR_ALWAYS_INLINE; - static inline void USB_Device_EnableDeviceAddress(void) + static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE; + static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) { - /* No implementation for XMEGA architecture */ + USB.ADDR = Address; } static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h index 84966ad6f..2198b53c7 100644 --- a/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h +++ b/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h @@ -57,6 +57,13 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) + /* Macros: */ + #if defined(MAX_ENDPOINT_INDEX) + #define ENDPOINT_TABLE_COUNT (MAX_ENDPOINT_INDEX + 1) + #else + #define ENDPOINT_TABLE_COUNT 16 + #endif + /* Type Defines: */ typedef struct { @@ -64,7 +71,7 @@ { USB_EP_t OUT; USB_EP_t IN; - } Endpoints[16]; + } Endpoints[ENDPOINT_TABLE_COUNT]; uint16_t FrameNum; } ATTR_PACKED USB_EndpointTable_t; |