extmod: Move fsusermount.c from stmhal for cross-port reuse.
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 891b93e..5653c48 100644
--- a/py/builtin.h
+++ b/py/builtin.h
@@ -105,4 +105,7 @@
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 00a8c59..75e7f46 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -167,6 +167,7 @@
../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 de41d92..1e8af39 100644
--- a/stmhal/Makefile
+++ b/stmhal/Makefile
@@ -153,7 +153,6 @@
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 8c8c8ee..6d0a8b4 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 98eb159..7433631 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 e8dcd57..be71f3f 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 8864ec5..b4c0ba5 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