Ensure device address latch bit is not set at the same time as the new address, as...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Device.h
index 3007936..a37e6d9 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)
                        {
-                               UDADDR = ((1 << ADDEN) | (Address & 0x7F));
+                               UDADDR  = ((UDADDR & (1 << ADDEN)) | (Address & 0x7F));
+                               UDADDR |= (1 << ADDEN);
                        }                       
        #endif