aboutsummaryrefslogtreecommitdiffstats
path: root/src/gfile/gfile.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-06-27 06:10:18 +0200
committerJoel Bodenmann <joel@unormal.org>2014-06-27 06:10:18 +0200
commit65602895a59f9e9c79ca65342ee3b843ba37183f (patch)
tree9110633ce9df9b2b99d550d9fd4bc46c76f6afaa /src/gfile/gfile.c
parent11e3d1fa22ee8df088621dfefe5ebfa4b0697d9c (diff)
downloaduGFX-65602895a59f9e9c79ca65342ee3b843ba37183f.tar.gz
uGFX-65602895a59f9e9c79ca65342ee3b843ba37183f.tar.bz2
uGFX-65602895a59f9e9c79ca65342ee3b843ba37183f.zip
FatFS complete implementation
Diffstat (limited to 'src/gfile/gfile.c')
-rw-r--r--src/gfile/gfile.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gfile/gfile.c b/src/gfile/gfile.c
index 7af27cbf..a410a801 100644
--- a/src/gfile/gfile.c
+++ b/src/gfile/gfile.c
@@ -56,6 +56,8 @@ typedef struct GFILEVMT {
bool_t (*setpos) (GFILE *f, long int pos);
long int (*getsize) (GFILE *f);
bool_t (*eof) (GFILE *f);
+ bool_t (*mount) (const char *drive);
+ bool_t (*unmount) (const char *drive);
} GFILEVMT;
// The chain of FileSystems
@@ -475,6 +477,36 @@ bool_t gfileEOF(GFILE *f) {
return f->vmt->eof(f);
}
+#if GFILE_NEED_FATFS
+ bool_t gfileMount(char fs, const char* drive) {
+ const GFILEVMT *p;
+
+ // Find the correct VMT
+ for(p = FsChain; p; p = p->next) {
+ if (p->prefix == fs) {
+ if (!p->mount)
+ return FALSE;
+ return p->mount(drive);
+ }
+ }
+ return FALSE;
+ }
+
+ bool_t gfileUnmount(char fs, const char* drive) {
+ const GFILEVMT *p;
+
+ // Find the correct VMT
+ for(p = FsChain; p; p = p->next) {
+ if (p->prefix == fs) {
+ if (!p->mount)
+ return FALSE;
+ return p->unmount(drive);
+ }
+ }
+ return FALSE;
+ }
+#endif
+
/********************************************************
* String VMT routines
********************************************************/