aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-05-13 07:43:18 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-05-13 07:43:18 +0000
commit1331cce08a6e899b15382dd1c6110565ed1b34c5 (patch)
tree605cb31983e33a4aaa9a05686d8bad9beea19403 /LUFA/Drivers
parentd3c623e1e184bb36873c1ba9664f0c8266139589 (diff)
downloadlufa-1331cce08a6e899b15382dd1c6110565ed1b34c5.tar.gz
lufa-1331cce08a6e899b15382dd1c6110565ed1b34c5.tar.bz2
lufa-1331cce08a6e899b15382dd1c6110565ed1b34c5.zip
Fixed possible device lockup when INTERRUPT_CONTROL_ENDPOINT is enabled and the control endpoint is not properly selected when the ISR completes.
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r--LUFA/Drivers/USB/LowLevel/USBInterrupt.c7
-rw-r--r--LUFA/Drivers/USB/LowLevel/USBInterrupt.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/USBInterrupt.c b/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
index 43df5f61a..1c6d6caa7 100644
--- a/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
+++ b/LUFA/Drivers/USB/LowLevel/USBInterrupt.c
@@ -237,10 +237,13 @@ ISR(USB_COM_vect, ISR_BLOCK)
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
USB_INT_Disable(USB_INT_RXSTPI);
- sei();
- USB_USBTask();
+ NONATOMIC_BLOCK(NONATOMIC_FORCEOFF)
+ {
+ USB_Device_ProcessControlRequest();
+ }
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
USB_INT_Enable(USB_INT_RXSTPI);
Endpoint_SelectEndpoint(PrevSelectedEndpoint);
}
diff --git a/LUFA/Drivers/USB/LowLevel/USBInterrupt.h b/LUFA/Drivers/USB/LowLevel/USBInterrupt.h
index a191a2994..6f8bf7cea 100644
--- a/LUFA/Drivers/USB/LowLevel/USBInterrupt.h
+++ b/LUFA/Drivers/USB/LowLevel/USBInterrupt.h
@@ -44,6 +44,7 @@
/* Includes: */
#include <avr/io.h>
#include <avr/interrupt.h>
+ #include <util/atomic.h>
#include <stdbool.h>
#include "../../../Common/Common.h"