From 3a1bbcc2ef46bbab90ef3cde88dfcd8810e71d74 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 25 Nov 2015 00:43:11 +0200 Subject: [PATCH] extmod: Move fsusermount.c from stmhal for cross-port reuse. --- {stmhal => extmod}/fsusermount.c | 0 {stmhal => extmod}/fsusermount.h | 0 py/builtin.h | 3 +++ py/py.mk | 1 + stmhal/Makefile | 1 - stmhal/diskio.c | 2 +- stmhal/ffconf.c | 2 +- stmhal/modpyb.c | 2 +- stmhal/moduos.c | 2 +- 9 files changed, 8 insertions(+), 5 deletions(-) rename {stmhal => extmod}/fsusermount.c (100%) rename {stmhal => extmod}/fsusermount.h (100%) diff --git a/stmhal/fsusermount.c b/extmod/fsusermount.c similarity index 100% rename from stmhal/fsusermount.c rename to extmod/fsusermount.c diff --git a/stmhal/fsusermount.h b/extmod/fsusermount.h similarity index 100% rename from stmhal/fsusermount.h rename to extmod/fsusermount.h diff --git a/py/builtin.h b/py/builtin.h index 891b93e9a5..5653c48d30 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -105,4 +105,7 @@ extern const mp_obj_module_t mp_module_ussl; extern const mp_obj_module_t mp_module_machine; extern const mp_obj_module_t mp_module_lwip; +// extmod functions +MP_DECLARE_CONST_FUN_OBJ(pyb_mount_obj); + #endif // __MICROPY_INCLUDED_PY_BUILTIN_H__ diff --git a/py/py.mk b/py/py.mk index 00a8c59b6c..75e7f461e4 100644 --- a/py/py.mk +++ b/py/py.mk @@ -167,6 +167,7 @@ PY_O_BASENAME = \ ../extmod/modubinascii.o \ ../extmod/modmachine.o \ ../extmod/modussl.o \ + ../extmod/fsusermount.o \ # prepend the build destination prefix to the py object files PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME)) diff --git a/stmhal/Makefile b/stmhal/Makefile index de41d9261f..1e8af39876 100644 --- a/stmhal/Makefile +++ b/stmhal/Makefile @@ -153,7 +153,6 @@ SRC_C = \ storage.c \ file.c \ sdcard.c \ - fsusermount.c \ diskio.c \ ffconf.c \ lcd.c \ diff --git a/stmhal/diskio.c b/stmhal/diskio.c index 8c8c8ee15b..6d0a8b40cd 100644 --- a/stmhal/diskio.c +++ b/stmhal/diskio.c @@ -38,7 +38,7 @@ #include "rtc.h" #include "storage.h" #include "sdcard.h" -#include "fsusermount.h" +#include "extmod/fsusermount.h" const PARTITION VolToPart[] = { {0, 1}, // Logical drive 0 ==> Physical drive 0, 1st partition diff --git a/stmhal/ffconf.c b/stmhal/ffconf.c index 98eb159b62..74336310a7 100644 --- a/stmhal/ffconf.c +++ b/stmhal/ffconf.c @@ -30,7 +30,7 @@ #include "lib/fatfs/ff.h" #include "lib/fatfs/ffconf.h" #include "lib/fatfs/diskio.h" -#include "fsusermount.h" +#include "extmod/fsusermount.h" STATIC bool check_path(const TCHAR **path, const char *mount_point_str, mp_uint_t mount_point_len) { if (strncmp(*path, mount_point_str, mount_point_len) == 0) { diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c index e8dcd57a0f..be71f3f80e 100644 --- a/stmhal/modpyb.c +++ b/stmhal/modpyb.c @@ -33,6 +33,7 @@ #include "py/nlr.h" #include "py/obj.h" #include "py/gc.h" +#include "py/builtin.h" #include "lib/utils/pyexec.h" #include "lib/fatfs/ff.h" #include "lib/fatfs/diskio.h" @@ -58,7 +59,6 @@ #include "dac.h" #include "lcd.h" #include "usb.h" -#include "fsusermount.h" #include "portmodules.h" #include "modmachine.h" diff --git a/stmhal/moduos.c b/stmhal/moduos.c index 8864ec582a..b4c0ba5297 100644 --- a/stmhal/moduos.c +++ b/stmhal/moduos.c @@ -38,7 +38,7 @@ #include "uart.h" #include "file.h" #include "sdcard.h" -#include "fsusermount.h" +#include "extmod/fsusermount.h" #include "portmodules.h" /// \module os - basic "operating system" services