aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Core/DeviceStandardReq.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2013-01-03 10:53:47 +0000
committerDean Camera <dean@fourwalledcubicle.com>2013-01-03 10:53:47 +0000
commit2608fd1dd48096c1867676de337767ff3fb1a951 (patch)
treecca01486688aaa7dfa9426a0afdf23f0834f5c87 /LUFA/Drivers/USB/Core/DeviceStandardReq.c
parent7d037c7db812be4dac1a742c990f3631fbd82cb5 (diff)
downloadlufa-2608fd1dd48096c1867676de337767ff3fb1a951.tar.gz
lufa-2608fd1dd48096c1867676de337767ff3fb1a951.tar.bz2
lufa-2608fd1dd48096c1867676de337767ff3fb1a951.zip
Fixed hardware race condition that could cause failed device enumerations for AVR8 and UC3 architectures (thanks to Mike Beyhs).
Fixed incorrect Minimus board LED definitions (thanks to Joonas Lahtinen). Fixed incorrect LED masks for received data display in the Device GenericHID demos (thanks to Denys Berkovskyy).
Diffstat (limited to 'LUFA/Drivers/USB/Core/DeviceStandardReq.c')
-rw-r--r--LUFA/Drivers/USB/Core/DeviceStandardReq.c11
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)