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.
Fork of USBFileSystem by
Diff: USBFileSystem.cpp
- Revision:
- 1:4ba08d11e36e
- Parent:
- 0:dabe3383ef23
- Child:
- 2:9af05743d551
--- a/USBFileSystem.cpp Wed Jul 31 19:15:55 2013 +0000
+++ b/USBFileSystem.cpp Fri Aug 02 18:49:27 2013 +0000
@@ -7,6 +7,7 @@
usbFunction = NULL;
usbfree = true;
local_count = 0;
+ usbmode = 0;
}
@@ -98,10 +99,16 @@
}
//Pseudo-IRQ
- if (localFunction != NULL) {
- if (open && (local_count == 1))
+ if (open && (local_count == 1)) {
+ if (usbmode == 1)
+ disconnect();
+ if (localFunction != NULL)
(*localFunction)(false);
- if (!open && (local_count == 0))
+ }
+ if (!open && (local_count == 0)) {
+ if (usbmode == 1)
+ connect();
+ if (localFunction != NULL)
(*localFunction)(true);
}
}
@@ -118,4 +125,8 @@
usbfree = true;
if (usbFunction != NULL)
usbFunction(true);
+}
+
+void USBFileSystem::usbMode(int mode) {
+ usbmode = mode;
}
\ No newline at end of file
