aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Core/DeviceStandardReq.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-04-08 04:49:20 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-04-08 04:49:20 +0000
commit70284d390f524e84e0539ad1e869366aaf94cf24 (patch)
treeb250bd819829b6e2807f4c85bd1342aa979eeb28 /LUFA/Drivers/USB/Core/DeviceStandardReq.c
parent0c5afda7e8d7c3bbaa15297c05d39dc4c90e4d5b (diff)
downloadlufa-70284d390f524e84e0539ad1e869366aaf94cf24.tar.gz
lufa-70284d390f524e84e0539ad1e869366aaf94cf24.tar.bz2
lufa-70284d390f524e84e0539ad1e869366aaf94cf24.zip
Add in a new common Delay_MS() function, which provides a blocking delay for all architectures.
Remove use of avr-libc specific ATOMIC_BLOCK, replace with a new per-architecture set of inline functions to retrieve and manipulate the global interrupt enable bit for each architecture. Add in documentation for the USB controller common interrupt routine which must be linked to the interrupt controller in the user application on the AVR32 UC3 architecture.
Diffstat (limited to 'LUFA/Drivers/USB/Core/DeviceStandardReq.c')
-rw-r--r--LUFA/Drivers/USB/Core/DeviceStandardReq.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/LUFA/Drivers/USB/Core/DeviceStandardReq.c b/LUFA/Drivers/USB/Core/DeviceStandardReq.c
index e36820387..a502c0949 100644
--- a/LUFA/Drivers/USB/Core/DeviceStandardReq.c
+++ b/LUFA/Drivers/USB/Core/DeviceStandardReq.c
@@ -114,20 +114,20 @@ void USB_Device_ProcessControlRequest(void)
static void USB_Device_SetAddress(void)
{
- uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F);
-
- ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
- {
- Endpoint_ClearSETUP();
+ uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F);
+ uint_reg_t CurrentGlobalInt = USB_INT_GetGlobalEnableState();
+ USB_INT_GlobalDisable();
+
+ Endpoint_ClearSETUP();
- Endpoint_ClearStatusStage();
+ Endpoint_ClearStatusStage();
- while (!(Endpoint_IsINReady()));
+ while (!(Endpoint_IsINReady()));
- USB_Device_SetDeviceAddress(DeviceAddress);
- }
-
+ USB_Device_SetDeviceAddress(DeviceAddress);
USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default;
+
+ USB_INT_SetGlobalEnableState(CurrentGlobalInt);
}
static void USB_Device_SetConfiguration(void)