diff options
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r-- | LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h | 10 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h | 9 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/DeviceStandardReq.c | 11 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/UC3/Device_UC3.h | 7 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h | 6 |
5 files changed, 26 insertions, 17 deletions
diff --git a/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h b/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h index ceeb44bc1..f153629ae 100644 --- a/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h @@ -44,9 +44,8 @@ * * <table> * <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr> - * <tr><td>LEDS_LED1</td><td>Red</td><td>General Indicator</td><td>Low</td><td>PORTD.5</td></tr> - * <tr><td>LEDS_LED2</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTD.6</td></tr> - * <tr><td>LEDS_LED3</td><td>Blue</td><td>General Indicator</td><td>Low</td><td>PORTD.7</td></tr> + * <tr><td>LEDS_LED1</td><td>Blue</td><td>General Indicator</td><td>Low</td><td>PORTD.5</td></tr> + * <tr><td>LEDS_LED2</td><td>Red</td><td>General Indicator</td><td>Low</td><td>PORTD.6</td></tr> * </table> * * @{ @@ -76,11 +75,8 @@ /** LED mask for the second LED on the board. */ #define LEDS_LED2 (1 << 6) - /** LED mask for the third LED on the board. */ - #define LEDS_LED3 (1 << 7) - /** LED mask for all the LEDs on the board. */ - #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3) + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2) /** LED mask for the none of the board LEDs. */ #define LEDS_NO_LEDS 0 diff --git a/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h b/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h index d60cb336a..e0435e21b 100644 --- a/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h +++ b/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h @@ -210,10 +210,13 @@ static inline void USB_Device_SetDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE; static inline void USB_Device_SetDeviceAddress(const uint8_t Address) { - uint8_t Temp = (UDADDR & (1 << ADDEN)) | (Address & 0x7F); + UDADDR = (UDADDR & (1 << ADDEN)) | (Address & 0x7F); + } - UDADDR = Temp; - UDADDR = Temp | (1 << ADDEN); + static inline void USB_Device_EnableDeviceAddress(void) ATTR_ALWAYS_INLINE; + static inline void USB_Device_EnableDeviceAddress(void) + { + UDADDR |= (1 << ADDEN); } static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/USB/Core/DeviceStandardReq.c b/LUFA/Drivers/USB/Core/DeviceStandardReq.c index ef1a278d4..514286dc1 100644 --- a/LUFA/Drivers/USB/Core/DeviceStandardReq.c +++ b/LUFA/Drivers/USB/Core/DeviceStandardReq.c @@ -124,9 +124,9 @@ void USB_Device_ProcessControlRequest(void) static void USB_Device_SetAddress(void) { - uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F); - uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); - GlobalInterruptDisable(); + uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F); + + USB_Device_SetDeviceAddress(DeviceAddress); Endpoint_ClearSETUP(); @@ -134,10 +134,9 @@ static void USB_Device_SetAddress(void) while (!(Endpoint_IsINReady())); - USB_Device_SetDeviceAddress(DeviceAddress); - USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; + USB_Device_EnableDeviceAddress(); - SetGlobalInterruptMask(CurrentGlobalInt); + USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; } static void USB_Device_SetConfiguration(void) diff --git a/LUFA/Drivers/USB/Core/UC3/Device_UC3.h b/LUFA/Drivers/USB/Core/UC3/Device_UC3.h index 35e081b37..603caad3f 100644 --- a/LUFA/Drivers/USB/Core/UC3/Device_UC3.h +++ b/LUFA/Drivers/USB/Core/UC3/Device_UC3.h @@ -209,7 +209,12 @@ static inline void USB_Device_SetDeviceAddress(const uint8_t Address) { AVR32_USBB.UDCON.uadd = Address; - AVR32_USBB.UDCON.adden = (Address ? true : false); + } + + static inline void USB_Device_EnableDeviceAddress(void) ATTR_ALWAYS_INLINE; + static inline void USB_Device_EnableDeviceAddress(void) + { + AVR32_USBB.UDCON.adden = true; } static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h index 7dd020296..1cf3557b5 100644 --- a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h +++ b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h @@ -208,6 +208,12 @@ USB.ADDR = Address; } + static inline void USB_Device_EnableDeviceAddress(void) ATTR_ALWAYS_INLINE; + static inline void USB_Device_EnableDeviceAddress(void) + { + /* No implementation for XMEGA architecture */ + } + static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; static inline bool USB_Device_IsAddressSet(void) { |