Class that contain only FATFileSystem
Fork of USBFileSystem by
Diff: USBFileSystem.h
- Revision:
- 6:eeeea7fbb0a2
- Parent:
- 2:9af05743d551
--- a/USBFileSystem.h Wed Oct 23 20:32:07 2013 +0000 +++ b/USBFileSystem.h Fri Dec 19 14:41:08 2014 +0000 @@ -2,7 +2,6 @@ #define USBFILESYSTEM_H #include "FATFileSystem.h" -#include "USBMSD.h" #include "FATFileHandle.h" class FATFileSystem_ds : public FATFileSystem { @@ -14,15 +13,6 @@ virtual int disk_status( void ) {return disk_status_fat();} }; -class USBMSD_ds : public USBMSD { - public: - USBMSD_ds() {}; - - protected: - virtual int disk_status_msd( void ) = 0; - virtual int disk_status( void ) {return disk_status_msd();} -}; - /** Class which combines FATFileSystem with USBMSD device * * The functions to be implemented by the child class are the same as @@ -53,7 +43,7 @@ * * See the program's wiki for more documentation! */ -class USBFileSystem : public FATFileSystem_ds, public USBMSD_ds { +class USBFileSystem : public FATFileSystem_ds { public: /** * Constructor for USBFileSystem @@ -70,35 +60,12 @@ */ void attachLocal(void (*function)(bool)); - /** Attach a function to be called when USB occupies/frees the filesystem - * - * The function is called with 'true' as argument when it is freed, false when it is occupied - * - * @param function - Function to be called, must have void as return type, and a single boolean argument - */ - void attachUSB(void (*function)(bool)); - /** Check if locally files are opened for write * * @return - true if none are opened for write, false otherwise */ bool localSafe( void ); - /** Check if via USB files files are being written - * - * @return - true if none are being written, false otherwise - */ - bool usbSafe( void ); - - /** Sets the USB mode - * - * Argument = 0: USB is write protected when not available. - * Argument = 1: USB is disconnected when not available (default). - * - * @param mode - USB safety mode - */ - void usbMode( int mode ); - protected: //Functions to be implemented by child: @@ -113,7 +80,6 @@ //Not to be implemented by child: virtual FileHandle* open(const char* name, int flags); void localOpen( bool open ); - void usbFree( void ); private: virtual int disk_status_fat(void); @@ -121,13 +87,9 @@ virtual int disk_write(const uint8_t * buffer, uint64_t sector); int local_count; - int usbmode; - Timeout usb_write; - bool usbfree; void (*localFunction)(bool); - void (*usbFunction)(bool); - + void (*usbFunction)(bool); friend class USBFileHandle; };