Class that contain only FATFileSystem
Fork of USBFileSystem by
Diff: USBFileSystem.cpp
- Revision:
- 1:4ba08d11e36e
- Parent:
- 0:dabe3383ef23
- Child:
- 2:9af05743d551
diff -r dabe3383ef23 -r 4ba08d11e36e USBFileSystem.cpp --- 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