From 303502936357469ad00a5d2a18879fc2831a5677 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 3 Mar 2022 18:11:09 +1100 Subject: [PATCH] esp32: Enable VfsMap. Signed-off-by: Damien George --- ports/esp32/modules/_boot.py | 7 +++++++ ports/esp32/mpconfigport.h | 1 + 2 files changed, 8 insertions(+) diff --git a/ports/esp32/modules/_boot.py b/ports/esp32/modules/_boot.py index 96af581f38..6ff771425b 100644 --- a/ports/esp32/modules/_boot.py +++ b/ports/esp32/modules/_boot.py @@ -1,7 +1,14 @@ import gc import vfs +from esp32 import Partition from flashbdev import bdev +if mapfs := Partition.find(Partition.TYPE_DATA, label="mapfs"): + import sys + + sys.path.insert(0, "/mapfs") +del mapfs + try: if bdev: vfs.mount(bdev, "/") diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h index acf065384b..e2004f463b 100644 --- a/ports/esp32/mpconfigport.h +++ b/ports/esp32/mpconfigport.h @@ -71,6 +71,7 @@ #define MICROPY_USE_INTERNAL_PRINTF (0) // ESP32 SDK requires its own printf #define MICROPY_SCHEDULER_DEPTH (8) #define MICROPY_VFS (1) +#define MICROPY_VFS_MAP (1) // control over Python builtins #define MICROPY_PY_STR_BYTES_CMP_WARN (1)