Fixed hardware race condition that could cause failed device enumerations for AVR8...
[pub/USBasp.git] / LUFA / Drivers / USB / Core / AVR8 / Device_AVR8.h
index d60cb33..e0435e2 100644 (file)
                        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;