summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-11-25 00:43:11 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-11-25 13:19:36 +0200
commitf0fbab7ca790f4f316bc2a9a44dc3a83f442664d (patch)
tree8a27fde06cfc71c69dc9105581eb7a2383e8cbc3
parent3a1bbcc2ef46bbab90ef3cde88dfcd8810e71d74 (diff)
extmod/fsusermount: Make configurable with MICROPY_FSUSERMOUNT.
-rw-r--r--extmod/fsusermount.c5
-rw-r--r--py/mpconfig.h5
-rw-r--r--stmhal/mpconfigport.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/extmod/fsusermount.c b/extmod/fsusermount.c
index 2fc24be1b..8153a551c 100644
--- a/extmod/fsusermount.c
+++ b/extmod/fsusermount.c
@@ -24,6 +24,9 @@
* THE SOFTWARE.
*/
+#include "py/mpconfig.h"
+#if MICROPY_FSUSERMOUNT
+
#include "py/nlr.h"
#include "py/runtime.h"
#include "lib/fatfs/ff.h"
@@ -110,3 +113,5 @@ STATIC mp_obj_t pyb_mount(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_KW(pyb_mount_obj, 2, pyb_mount);
+
+#endif // MICROPY_FSUSERMOUNT
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 1453560e0..686f90c25 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -469,6 +469,11 @@ typedef double mp_float_t;
#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (1)
#endif
+// Support for user-space VFS mount (selected ports)
+#ifndef MICROPY_FSUSERMOUNT
+#define MICROPY_FSUSERMOUNT (0)
+#endif
+
/*****************************************************************************/
/* Fine control over Python builtins, classes, modules, etc */
diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h
index fec2c1236..8a22ee461 100644
--- a/stmhal/mpconfigport.h
+++ b/stmhal/mpconfigport.h
@@ -54,6 +54,7 @@
#define MICROPY_FATFS_RPATH (2)
#define MICROPY_FATFS_VOLUMES (3)
#define MICROPY_FATFS_MULTI_PARTITION (1)
+#define MICROPY_FSUSERMOUNT (1)
#define MICROPY_STREAMS_NON_BLOCK (1)
#define MICROPY_MODULE_WEAK_LINKS (1)