File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed
Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ void mp_main(void) {
5353 for (;;) {
5454 microbit_system_init ();
5555 microbit_display_init ();
56+ #if MICROPY_MBFS
5657 microbit_filesystem_init ();
58+ #endif
5759
5860 gc_init (heap , heap + sizeof (heap ));
5961 mp_init ();
Original file line number Diff line number Diff line change @@ -66,24 +66,28 @@ STATIC mp_obj_t os_uname(void) {
6666}
6767STATIC MP_DEFINE_CONST_FUN_OBJ_0 (os_uname_obj , os_uname );
6868
69+ #if MICROPY_MBFS
6970STATIC mp_obj_t os_size (mp_obj_t filename ) {
7071 mp_obj_tuple_t * tuple = MP_OBJ_TO_PTR (uos_mbfs_stat_obj .fun ._1 (filename ));
7172 return tuple -> items [6 ];
7273}
7374STATIC MP_DEFINE_CONST_FUN_OBJ_1 (os_size_obj , os_size );
75+ #endif
7476
7577STATIC const mp_rom_map_elem_t os_module_globals_table [] = {
7678 { MP_ROM_QSTR (MP_QSTR___name__ ), MP_ROM_QSTR (MP_QSTR_os ) },
7779
7880 { MP_ROM_QSTR (MP_QSTR_uname ), MP_ROM_PTR (& os_uname_obj ) },
7981
82+ #if MICROPY_MBFS
8083 { MP_ROM_QSTR (MP_QSTR_listdir ), MP_ROM_PTR (& uos_mbfs_listdir_obj ) },
8184 { MP_ROM_QSTR (MP_QSTR_ilistdir ), MP_ROM_PTR (& uos_mbfs_ilistdir_obj ) },
8285 { MP_ROM_QSTR (MP_QSTR_remove ), MP_ROM_PTR (& uos_mbfs_remove_obj ) },
8386 { MP_ROM_QSTR (MP_QSTR_stat ), MP_ROM_PTR (& uos_mbfs_stat_obj ) },
8487
8588 // micro:bit v1 specific
8689 { MP_ROM_QSTR (MP_QSTR_size ), MP_ROM_PTR (& os_size_obj ) },
90+ #endif
8791};
8892STATIC MP_DEFINE_CONST_DICT (os_module_globals , os_module_globals_table );
8993
Original file line number Diff line number Diff line change 9191#define MICROPY_MBFS (1)
9292
9393// extra built in names to add to the global namespace
94+ #if MICROPY_MBFS
9495#define MICROPY_PORT_BUILTINS \
9596 { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
97+ #endif
9698
9799#define MICROBIT_RELEASE "2.0.0-beta.5"
98100#define MICROBIT_BOARD_NAME "micro:bit"
You can’t perform that action at this time.
0 commit comments