aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h')
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h48
1 files changed, 25 insertions, 23 deletions
diff --git a/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h b/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h
index e9696089f..9899251ee 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h
+++ b/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h
@@ -155,28 +155,28 @@
}
#if !defined(NO_SOF_EVENTS)
- /** Enables the device mode Start Of Frame events. When enabled, this causes the
- * \ref EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
- * at the start of each USB frame when enumerated in device mode.
- *
- * \note Not available when the \c NO_SOF_EVENTS compile time token is defined.
- */
- static inline void USB_Device_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
- static inline void USB_Device_EnableSOFEvents(void)
- {
- USB_INT_Enable(USB_INT_SOFI);
- }
+ /** Enables the device mode Start Of Frame events. When enabled, this causes the
+ * \ref EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
+ * at the start of each USB frame when enumerated in device mode.
+ *
+ * \note Not available when the \c NO_SOF_EVENTS compile time token is defined.
+ */
+ static inline void USB_Device_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
+ static inline void USB_Device_EnableSOFEvents(void)
+ {
+ USB_INT_Enable(USB_INT_SOFI);
+ }
- /** Disables the device mode Start Of Frame events. When disabled, this stops the firing of the
- * \ref EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.
- *
- * \note Not available when the \c NO_SOF_EVENTS compile time token is defined.
- */
- static inline void USB_Device_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
- static inline void USB_Device_DisableSOFEvents(void)
- {
- USB_INT_Disable(USB_INT_SOFI);
- }
+ /** Disables the device mode Start Of Frame events. When disabled, this stops the firing of the
+ * \ref EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.
+ *
+ * \note Not available when the \c NO_SOF_EVENTS compile time token is defined.
+ */
+ static inline void USB_Device_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
+ static inline void USB_Device_DisableSOFEvents(void)
+ {
+ USB_INT_Disable(USB_INT_SOFI);
+ }
#endif
/* Private Interface - For use in library only: */
@@ -199,8 +199,10 @@
static inline void USB_Device_SetDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void USB_Device_SetDeviceAddress(const uint8_t Address)
{
- UDADDR = ((UDADDR & (1 << ADDEN)) | (Address & 0x7F));
- UDADDR |= (1 << ADDEN);
+ uint8_t Temp = (UDADDR & (1 << ADDEN)) | (Address & 0x7F);
+
+ UDADDR = Temp;
+ UDADDR = Temp | (1 << ADDEN);
}
static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;