diff options
| author | robert-hh <robert@hammelrath.com> | 2022-07-10 11:55:56 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-10-06 23:14:21 +1100 |
| commit | 972212907ddc7f611f41d7e267ceca396f1bb4ba (patch) | |
| tree | 1e71f5094de26e47b6a6001ed2711ad971108b84 | |
| parent | 4cf527eb05d9b9a93a92ec427e719bf81a8de305 (diff) | |
samd/mcu: Use lf2s for SAMD51 and lfs1 for SAMD21.
Using lfs1 gives a smaller code, but lfs2 has more features.
| -rw-r--r-- | ports/samd/mcu/samd21/mpconfigmcu.h | 1 | ||||
| -rw-r--r-- | ports/samd/mcu/samd51/mpconfigmcu.mk | 2 | ||||
| -rw-r--r-- | ports/samd/modules/_boot.py | 8 |
3 files changed, 8 insertions, 3 deletions
diff --git a/ports/samd/mcu/samd21/mpconfigmcu.h b/ports/samd/mcu/samd21/mpconfigmcu.h index 7ee23b59b..a84b31276 100644 --- a/ports/samd/mcu/samd21/mpconfigmcu.h +++ b/ports/samd/mcu/samd21/mpconfigmcu.h @@ -6,6 +6,7 @@ // MicroPython emitters #define MICROPY_EMIT_THUMB (0) #define MICROPY_EMIT_INLINE_THUMB (0) +#define MICROPY_MODULE_BUILTIN_INIT (1) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_PY_BUILTINS_COMPLEX (0) diff --git a/ports/samd/mcu/samd51/mpconfigmcu.mk b/ports/samd/mcu/samd51/mpconfigmcu.mk index 0aedbbe28..e83e8911d 100644 --- a/ports/samd/mcu/samd51/mpconfigmcu.mk +++ b/ports/samd/mcu/samd51/mpconfigmcu.mk @@ -1,3 +1,5 @@ +MICROPY_VFS_LFS2 ?= 1 + SRC_S += shared/runtime/gchelper_m3.s SRC_MOD += $(addprefix lib/libm/,\ diff --git a/ports/samd/modules/_boot.py b/ports/samd/modules/_boot.py index 84b02480b..e183125f2 100644 --- a/ports/samd/modules/_boot.py +++ b/ports/samd/modules/_boot.py @@ -6,11 +6,13 @@ samd.Flash.flash_init() bdev = samd.Flash() # Try to mount the filesystem, and format the flash if it doesn't exist. +fs_type = uos.VfsLfs2 if hasattr(uos, "VfsLfs2") else uos.VfsLfs1 + try: - vfs = uos.VfsLfs1(bdev) + vfs = fs_type(bdev) except: - uos.VfsLfs1.mkfs(bdev) - vfs = uos.VfsLfs1(bdev) + fs_type.mkfs(bdev) + vfs = fs_type(bdev) uos.mount(vfs, "/") gc.collect() |
