diff options
Diffstat (limited to 'LUFA/Drivers/USB/Core/DeviceStandardReq.c')
-rw-r--r-- | LUFA/Drivers/USB/Core/DeviceStandardReq.c | 11 |
1 files changed, 5 insertions, 6 deletions
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) |