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:
parent
4cf527eb05
commit
972212907d
@ -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)
|
||||
|
@ -1,3 +1,5 @@
|
||||
MICROPY_VFS_LFS2 ?= 1
|
||||
|
||||
SRC_S += shared/runtime/gchelper_m3.s
|
||||
|
||||
SRC_MOD += $(addprefix lib/libm/,\
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user