aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple/usb')
-rw-r--r--libmaple/usb/usb.c6
-rw-r--r--libmaple/usb/usb.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c
index 6c010d9..881c7f9 100644
--- a/libmaple/usb/usb.c
+++ b/libmaple/usb/usb.c
@@ -120,7 +120,13 @@ void setupUSB (void) {
/* initialize the usb application */
gpio_write_bit(USB_DISC_BANK,USB_DISC_PIN,0); /* present ourselves to the host */
USB_Init(); /* low level init routine provided by st lib */
+}
+void disableUSB (void) {
+ // These are just guesses about how to do this
+ // TODO: real disable function
+ usbDsbISR();
+ gpio_write_bit(USB_DISC_BANK,USB_DISC_PIN,1);
}
void usbSuspend(void) {
diff --git a/libmaple/usb/usb.h b/libmaple/usb/usb.h
index 66e820c..e0d4231 100644
--- a/libmaple/usb/usb.h
+++ b/libmaple/usb/usb.h
@@ -36,6 +36,7 @@ typedef enum
extern volatile uint32 bDeviceState;
void setupUSB(void);
+ void disableUSB(void);
void usbSuspend(void);
void usbResumeInit(void);
void usbResume(RESUME_STATE);