Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
7a833edf
Commit
7a833edf
authored
Jul 23, 2020
by
Glenn Ruben Bakke
Committed by
Damien George
Aug 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nrf/modules/uos: Allow a board to configure MICROPY_VFS_FAT/LFS1/LFS2.
parent
0bde907a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
ports/nrf/modules/uos/moduos.c
ports/nrf/modules/uos/moduos.c
+11
-0
No files found.
ports/nrf/modules/uos/moduos.c
View file @
7a833edf
...
...
@@ -36,6 +36,7 @@
#include "modules/uos/microbitfs.h"
#include "extmod/vfs.h"
#include "extmod/vfs_fat.h"
#include "extmod/vfs_lfs.h"
#include "genhdr/mpversion.h"
#include "uart.h"
...
...
@@ -85,10 +86,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname);
/// \function sync()
/// Sync all filesystems.
STATIC
mp_obj_t
os_sync
(
void
)
{
#if MICROPY_VFS_FAT
for
(
mp_vfs_mount_t
*
vfs
=
MP_STATE_VM
(
vfs_mount_table
);
vfs
!=
NULL
;
vfs
=
vfs
->
next
)
{
// this assumes that vfs->obj is fs_user_mount_t with block device functions
disk_ioctl
(
MP_OBJ_TO_PTR
(
vfs
->
obj
),
CTRL_SYNC
,
NULL
);
}
#endif
return
mp_const_none
;
}
MP_DEFINE_CONST_FUN_OBJ_0
(
mod_os_sync_obj
,
os_sync
);
...
...
@@ -174,7 +177,15 @@ STATIC const mp_rom_map_elem_t os_module_globals_table[] = {
#if MICROPY_VFS
{
MP_ROM_QSTR
(
MP_QSTR_mount
),
MP_ROM_PTR
(
&
mp_vfs_mount_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_umount
),
MP_ROM_PTR
(
&
mp_vfs_umount_obj
)
},
#if MICROPY_VFS_FAT
{
MP_ROM_QSTR
(
MP_QSTR_VfsFat
),
MP_ROM_PTR
(
&
mp_fat_vfs_type
)
},
#endif
#if MICROPY_VFS_LFS1
{
MP_ROM_QSTR
(
MP_QSTR_VfsLfs1
),
MP_ROM_PTR
(
&
mp_type_vfs_lfs1
)
},
#endif
#if MICROPY_VFS_LFS2
{
MP_ROM_QSTR
(
MP_QSTR_VfsLfs2
),
MP_ROM_PTR
(
&
mp_type_vfs_lfs2
)
},
#endif
#endif
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment