diff options
author | Damien George <damien.p.george@gmail.com> | 2019-12-16 15:42:17 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-12-27 22:54:20 +1100 |
commit | d97b40bdaaeb96920541e57f6d299fb0c84a7bfd (patch) | |
tree | e01176cca84df872df9255dbf6e408227eb0a6c4 /extmod/vfs.c | |
parent | 09376f0e47b3ab4a5a2a3c2c768ff913e1835cc8 (diff) |
py: Introduce MP_ROM_FALSE/MP_ROM_TRUE for ROM to refer to bool objects.
This helps to prevent mistakes, and allows easily changing the ROM value of
False/True if needed.
Diffstat (limited to 'extmod/vfs.c')
-rw-r--r-- | extmod/vfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/vfs.c b/extmod/vfs.c index e459287d4..8e3a0f18c 100644 --- a/extmod/vfs.c +++ b/extmod/vfs.c @@ -201,8 +201,8 @@ STATIC mp_obj_t mp_vfs_autodetect(mp_obj_t bdev_obj) { mp_obj_t mp_vfs_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_readonly, ARG_mkfs }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_readonly, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_false_obj)} }, - { MP_QSTR_mkfs, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_false_obj)} }, + { MP_QSTR_readonly, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_FALSE} }, + { MP_QSTR_mkfs, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_FALSE} }, }; // parse args |