From f0fbab7ca790f4f316bc2a9a44dc3a83f442664d Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 25 Nov 2015 00:43:11 +0200 Subject: [PATCH] extmod/fsusermount: Make configurable with MICROPY_FSUSERMOUNT. --- extmod/fsusermount.c | 5 +++++ py/mpconfig.h | 5 +++++ stmhal/mpconfigport.h | 1 + 3 files changed, 11 insertions(+) diff --git a/extmod/fsusermount.c b/extmod/fsusermount.c index 2fc24be1b2..8153a551cb 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 1453560e08..686f90c25d 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 fec2c1236d..8a22ee4610 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)