samd/mcu: Use lf2s for SAMD51 and lfs1 for SAMD21.
Using lfs1 gives a smaller code, but lfs2 has more features.
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
// MicroPython emitters
|
// MicroPython emitters
|
||||||
#define MICROPY_EMIT_THUMB (0)
|
#define MICROPY_EMIT_THUMB (0)
|
||||||
#define MICROPY_EMIT_INLINE_THUMB (0)
|
#define MICROPY_EMIT_INLINE_THUMB (0)
|
||||||
|
#define MICROPY_MODULE_BUILTIN_INIT (1)
|
||||||
|
|
||||||
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
||||||
#define MICROPY_PY_BUILTINS_COMPLEX (0)
|
#define MICROPY_PY_BUILTINS_COMPLEX (0)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
MICROPY_VFS_LFS2 ?= 1
|
||||||
|
|
||||||
SRC_S += shared/runtime/gchelper_m3.s
|
SRC_S += shared/runtime/gchelper_m3.s
|
||||||
|
|
||||||
SRC_MOD += $(addprefix lib/libm/,\
|
SRC_MOD += $(addprefix lib/libm/,\
|
||||||
|
|||||||
@@ -6,11 +6,13 @@ samd.Flash.flash_init()
|
|||||||
bdev = samd.Flash()
|
bdev = samd.Flash()
|
||||||
|
|
||||||
# Try to mount the filesystem, and format the flash if it doesn't exist.
|
# 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:
|
try:
|
||||||
vfs = uos.VfsLfs1(bdev)
|
vfs = fs_type(bdev)
|
||||||
except:
|
except:
|
||||||
uos.VfsLfs1.mkfs(bdev)
|
fs_type.mkfs(bdev)
|
||||||
vfs = uos.VfsLfs1(bdev)
|
vfs = fs_type(bdev)
|
||||||
uos.mount(vfs, "/")
|
uos.mount(vfs, "/")
|
||||||
|
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
|||||||
Reference in New Issue
Block a user