Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: STM32F103C8T6_WebUSBDFU STM32F103C8T6_USBDFU STM32F103C8T6_USBDFU dfu_usb_stm32f103
Fork of USBDevice_STM32F103 by
Revision 3:6d85e04fb59f, committed 2012-10-14
- Comitter:
- samux
- Date:
- Sun Oct 14 12:38:56 2012 +0000
- Parent:
- 2:34856a6adb5b
- Child:
- 4:eaa07ce86d49
- Commit message:
- move EnableIRQ to connect() - add MEDIA_REMOVAL handling
Changed in this revision
--- a/USBDevice/USBHAL_LPC11U.cpp Tue Jul 17 14:35:40 2012 +0000
+++ b/USBDevice/USBHAL_LPC11U.cpp Sun Oct 14 12:38:56 2012 +0000
@@ -176,7 +176,6 @@
//attach IRQ handler and enable interrupts
NVIC_SetVector(USB_IRQn, (uint32_t)&_usbisr);
- NVIC_EnableIRQ(USB_IRQn);
}
USBHAL::~USBHAL(void) {
@@ -188,11 +187,13 @@
}
void USBHAL::connect(void) {
+ NVIC_EnableIRQ(USB_IRQn);
devCmdStat |= DCON;
LPC_USB->DEVCMDSTAT = devCmdStat;
}
void USBHAL::disconnect(void) {
+ NVIC_DisableIRQ(USB_IRQn);
devCmdStat &= ~DCON;
LPC_USB->DEVCMDSTAT = devCmdStat;
}
--- 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();
}
--- a/USBMSD/USBMSD.cpp Tue Jul 17 14:35:40 2012 +0000
+++ b/USBMSD/USBMSD.cpp Sun Oct 14 12:38:56 2012 +0000
@@ -452,6 +452,10 @@
}
}
break;
+ case MEDIA_REMOVAL:
+ csw.Status = CSW_PASSED;
+ sendCSW();
+ break;
default:
fail();
break;
