8000 esp8266/main: mp_builtin_open(): Implement, using vfs_proxy_call(). · lapsule/micropython@c734de4 · GitHub
[go: up one dir, main page]

Skip to content

Commit c734de4

Browse files
committed
esp8266/main: mp_builtin_open(): Implement, using vfs_proxy_call().
1 parent 358e5d8 commit c734de4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

esp8266/main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,14 @@ mp_import_stat_t mp_import_stat(const char *path) {
123123
#endif
124124
}
125125

126+
mp_obj_t vfs_proxy_call(qstr method_name, mp_uint_t n_args, const mp_obj_t *args);
126127
mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) {
128+
#if MICROPY_VFS_FAT
129+
// TODO: Handle kwargs!
130+
return vfs_proxy_call(MP_QSTR_open, n_args, args);
131+
#else
127132
return mp_const_none;
133+
#endif
128134
}
129135
MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
130136

esp8266/moduos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ STATIC mp_obj_t os_uname(void) {
7272
STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname);
7373

7474
#if MICROPY_VFS_FAT
75-
STATIC mp_obj_t vfs_proxy_call(qstr method_name, mp_uint_t n_args, const mp_obj_t *args) {
75+
mp_obj_t vfs_proxy_call(qstr method_name, mp_uint_t n_args, const mp_obj_t *args) {
7676
if (MP_STATE_PORT(fs_user_mount)[0] == NULL) {
7777
nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(ENODEV)));
7878
}

0 commit comments

Comments
 (0)
0