summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cc3200/ftp/ftp.c2
-rw-r--r--cc3200/mods/pybflash.c1
-rw-r--r--cc3200/mods/pybsd.c2
-rw-r--r--cc3200/mptask.c2
-rw-r--r--extmod/fsusermount.h62
-rw-r--r--extmod/vfs.c5
-rw-r--r--extmod/vfs.h7
-rw-r--r--extmod/vfs_fat.c1
-rw-r--r--extmod/vfs_fat.h26
-rw-r--r--extmod/vfs_fat_diskio.c2
-rw-r--r--extmod/vfs_fat_file.c1
-rw-r--r--extmod/vfs_fat_misc.c1
-rw-r--r--stmhal/main.c2
-rw-r--r--stmhal/modmachine.c2
-rw-r--r--stmhal/sdcard.c1
-rw-r--r--stmhal/storage.c1
16 files changed, 42 insertions, 76 deletions
diff --git a/cc3200/ftp/ftp.c b/cc3200/ftp/ftp.c
index c8a52149c..679c32561 100644
--- a/cc3200/ftp/ftp.c
+++ b/cc3200/ftp/ftp.c
@@ -32,7 +32,7 @@
#include "py/obj.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs.h"
-#include "extmod/fsusermount.h"
+#include "extmod/vfs_fat.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
diff --git a/cc3200/mods/pybflash.c b/cc3200/mods/pybflash.c
index 0779f4a05..f5af79dbf 100644
--- a/cc3200/mods/pybflash.c
+++ b/cc3200/mods/pybflash.c
@@ -31,7 +31,6 @@
#include "lib/oofatfs/ff.h"
#include "lib/oofatfs/diskio.h"
#include "extmod/vfs_fat.h"
-#include "extmod/fsusermount.h"
#include "fatfs/src/drivers/sflash_diskio.h"
#include "mods/pybflash.h"
diff --git a/cc3200/mods/pybsd.c b/cc3200/mods/pybsd.c
index bac5a270c..937b8599d 100644
--- a/cc3200/mods/pybsd.c
+++ b/cc3200/mods/pybsd.c
@@ -29,7 +29,7 @@
#include "py/runtime.h"
#include "lib/oofatfs/ff.h"
#include "lib/oofatfs/diskio.h"
-#include "extmod/fsusermount.h"
+#include "extmod/vfs_fat.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "inc/hw_ints.h"
diff --git a/cc3200/mptask.c b/cc3200/mptask.c
index 476561c6d..c7c1832ed 100644
--- a/cc3200/mptask.c
+++ b/cc3200/mptask.c
@@ -36,7 +36,7 @@
#include "lib/oofatfs/ff.h"
#include "lib/oofatfs/diskio.h"
#include "extmod/vfs.h"
-#include "extmod/fsusermount.h"
+#include "extmod/vfs_fat.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
diff --git a/extmod/fsusermount.h b/extmod/fsusermount.h
deleted file mode 100644
index af6867d23..000000000
--- a/extmod/fsusermount.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * This file is part of the Micro Python project, http://micropython.org/
- *
- * The MIT License (MIT)
- *
- * Copyright (c) 2014 Damien P. George
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-// these are the values for fs_user_mount_t.flags
-#define FSUSER_NATIVE (0x0001) // readblocks[2]/writeblocks[2] contain native func
-#define FSUSER_FREE_OBJ (0x0002) // fs_user_mount_t obj should be freed on umount
-#define FSUSER_HAVE_IOCTL (0x0004) // new protocol with ioctl
-
-// constants for block protocol ioctl
-#define BP_IOCTL_INIT (1)
-#define BP_IOCTL_DEINIT (2)
-#define BP_IOCTL_SYNC (3)
-#define BP_IOCTL_SEC_COUNT (4)
-#define BP_IOCTL_SEC_SIZE (5)
-
-typedef struct _fs_user_mount_t {
- mp_obj_base_t base;
- const char *str;
- uint16_t len; // length of str
- uint16_t flags;
- mp_obj_t readblocks[4];
- mp_obj_t writeblocks[4];
- // new protocol uses just ioctl, old uses sync (optional) and count
- union {
- mp_obj_t ioctl[4];
- struct {
- mp_obj_t sync[2];
- mp_obj_t count[2];
- } old;
- } u;
- FATFS fatfs;
-} fs_user_mount_t;
-
-fs_user_mount_t *fatfs_mount_mkfs(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args, bool mkfs);
-mp_obj_t fatfs_umount(mp_obj_t bdev_or_path_in);
-
-MP_DECLARE_CONST_FUN_OBJ_KW(fsuser_mount_obj);
-MP_DECLARE_CONST_FUN_OBJ_1(fsuser_umount_obj);
-MP_DECLARE_CONST_FUN_OBJ_KW(fsuser_mkfs_obj);
diff --git a/extmod/vfs.c b/extmod/vfs.c
index 97c9077a2..1eb26acf1 100644
--- a/extmod/vfs.c
+++ b/extmod/vfs.c
@@ -31,10 +31,13 @@
#include "py/objstr.h"
#include "py/mperrno.h"
#include "extmod/vfs.h"
-#include "extmod/vfs_fat.h"
#if MICROPY_VFS
+#if MICROPY_VFS_FAT
+#include "extmod/vfs_fat.h"
+#endif
+
// path is the path to lookup and *path_out holds the path within the VFS
// object (starts with / if an absolute path).
// Returns MP_VFS_ROOT for root dir (and then path_out is undefined) and
diff --git a/extmod/vfs.h b/extmod/vfs.h
index 92e53b305..4a1c225a0 100644
--- a/extmod/vfs.h
+++ b/extmod/vfs.h
@@ -35,6 +35,13 @@
#define MP_VFS_NONE ((mp_vfs_mount_t*)1)
#define MP_VFS_ROOT ((mp_vfs_mount_t*)0)
+// constants for block protocol ioctl
+#define BP_IOCTL_INIT (1)
+#define BP_IOCTL_DEINIT (2)
+#define BP_IOCTL_SYNC (3)
+#define BP_IOCTL_SEC_COUNT (4)
+#define BP_IOCTL_SEC_SIZE (5)
+
typedef struct _mp_vfs_mount_t {
const char *str; // mount point with leading /
size_t len;
diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c
index ecbbdb59a..b32bf7ad9 100644
--- a/extmod/vfs_fat.c
+++ b/extmod/vfs_fat.c
@@ -38,7 +38,6 @@
#include "py/mperrno.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs_fat.h"
-#include "extmod/fsusermount.h"
#include "timeutils.h"
#if _MAX_SS == _MIN_SS
diff --git a/extmod/vfs_fat.h b/extmod/vfs_fat.h
index bc5be0c67..fefae776c 100644
--- a/extmod/vfs_fat.h
+++ b/extmod/vfs_fat.h
@@ -25,8 +25,32 @@
*/
#include "py/lexer.h"
+#include "py/obj.h"
+#include "lib/oofatfs/ff.h"
+#include "extmod/vfs.h"
-struct _fs_user_mount_t;
+// these are the values for fs_user_mount_t.flags
+#define FSUSER_NATIVE (0x0001) // readblocks[2]/writeblocks[2] contain native func
+#define FSUSER_FREE_OBJ (0x0002) // fs_user_mount_t obj should be freed on umount
+#define FSUSER_HAVE_IOCTL (0x0004) // new protocol with ioctl
+
+typedef struct _fs_user_mount_t {
+ mp_obj_base_t base;
+ const char *str;
+ uint16_t len; // length of str
+ uint16_t flags;
+ mp_obj_t readblocks[4];
+ mp_obj_t writeblocks[4];
+ // new protocol uses just ioctl, old uses sync (optional) and count
+ union {
+ mp_obj_t ioctl[4];
+ struct {
+ mp_obj_t sync[2];
+ mp_obj_t count[2];
+ } old;
+ } u;
+ FATFS fatfs;
+} fs_user_mount_t;
extern const byte fresult_to_errno_table[20];
extern const mp_obj_type_t mp_fat_vfs_type;
diff --git a/extmod/vfs_fat_diskio.c b/extmod/vfs_fat_diskio.c
index e12c4597e..7efcc22f2 100644
--- a/extmod/vfs_fat_diskio.c
+++ b/extmod/vfs_fat_diskio.c
@@ -38,7 +38,7 @@
#include "py/runtime.h"
#include "lib/oofatfs/ff.h"
#include "lib/oofatfs/diskio.h"
-#include "extmod/fsusermount.h"
+#include "extmod/vfs_fat.h"
#if _MAX_SS == _MIN_SS
#define SECSIZE(fs) (_MIN_SS)
diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c
index bb5903575..0f2a7a1aa 100644
--- a/extmod/vfs_fat_file.c
+++ b/extmod/vfs_fat_file.c
@@ -35,7 +35,6 @@
#include "py/stream.h"
#include "py/mperrno.h"
#include "lib/oofatfs/ff.h"
-#include "extmod/fsusermount.h"
#include "extmod/vfs_fat.h"
#if MICROPY_VFS_FAT
diff --git a/extmod/vfs_fat_misc.c b/extmod/vfs_fat_misc.c
index ba513ef92..97d2675cd 100644
--- a/extmod/vfs_fat_misc.c
+++ b/extmod/vfs_fat_misc.c
@@ -32,7 +32,6 @@
#include "py/runtime.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs_fat.h"
-#include "extmod/fsusermount.h"
#include "py/lexer.h"
// TODO: actually, the core function should be ilistdir()
diff --git a/stmhal/main.c b/stmhal/main.c
index 9eab50061..3a0bd7a6b 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -39,7 +39,7 @@
#include "lib/utils/pyexec.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs.h"
-#include "extmod/fsusermount.h"
+#include "extmod/vfs_fat.h"
#include "systick.h"
#include "pendsv.h"
diff --git a/stmhal/modmachine.c b/stmhal/modmachine.c
index aec8e29c5..b10bca819 100644
--- a/stmhal/modmachine.c
+++ b/stmhal/modmachine.c
@@ -37,7 +37,7 @@
#include "lib/utils/pyexec.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs.h"
-#include "extmod/fsusermount.h"
+#include "extmod/vfs_fat.h"
#include "gccollect.h"
#include "irq.h"
#include "rng.h"
diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c
index 52ede492b..b1d67f62a 100644
--- a/stmhal/sdcard.c
+++ b/stmhal/sdcard.c
@@ -30,7 +30,6 @@
#include "py/runtime.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs_fat.h"
-#include "extmod/fsusermount.h"
#include "mphalport.h"
#include "sdcard.h"
diff --git a/stmhal/storage.c b/stmhal/storage.c
index 6130d6fb8..c1daad4c2 100644
--- a/stmhal/storage.c
+++ b/stmhal/storage.c
@@ -31,7 +31,6 @@
#include "py/runtime.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs_fat.h"
-#include "extmod/fsusermount.h"
#include "systick.h"
#include "led.h"