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);
}
while (!(Endpoint_IsINReady()));
- USB_Device_EnableDeviceAddress();
+ USB_Device_EnableDeviceAddress(DeviceAddress);
USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default;
}
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;
}
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;
/* 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
{
{
USB_EP_t OUT;
USB_EP_t IN;
- } Endpoints[16];
+ } Endpoints[ENDPOINT_TABLE_COUNT];
uint16_t FrameNum;
} ATTR_PACKED USB_EndpointTable_t;