USB device stack (USBDevice::connect non-blocking)

Fork of USBDevice by mbed official

Revision:
3:6d85e04fb59f
Parent:
1:80ab0d068708
Child:
8:335f2506f422
--- a/USBDevice/USBHAL_LPC17.cpp	Tue Jul 17 14:35:40 2012 +0000
+++ b/USBDevice/USBHAL_LPC17.cpp	Sun Oct 14 12:38:56 2012 +0000
@@ -371,7 +371,6 @@
     // Attach IRQ
     instance = this;
     NVIC_SetVector(USB_IRQn, (uint32_t)&_usbisr);
-    NVIC_EnableIRQ(USB_IRQn);
 
     // Enable interrupts for device events and EP0
     LPC_USB->USBDevIntEn = EP_SLOW | DEV_STAT | FRAME;
@@ -388,11 +387,13 @@
 }
 
 void USBHAL::connect(void) {
+    NVIC_EnableIRQ(USB_IRQn);
     // Connect USB device
     SIEconnect();
 }
 
 void USBHAL::disconnect(void) {
+    NVIC_DisableIRQ(USB_IRQn);
     // Disconnect USB device
     SIEdisconnect();
 }