From f5d04750dbd13bfc10498e20428b1a285ec417af Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 27 Jul 2015 23:52:56 +0100 Subject: stmhal: Put fs_user_mount pointer in root ptr section of global state. Should fix issue #1393. --- stmhal/moduos.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'stmhal/moduos.c') diff --git a/stmhal/moduos.c b/stmhal/moduos.c index 55404c77b..4a8261e41 100644 --- a/stmhal/moduos.c +++ b/stmhal/moduos.c @@ -27,8 +27,7 @@ #include #include -#include "py/nlr.h" -#include "py/obj.h" +#include "py/mpstate.h" #include "py/objtuple.h" #include "py/objstr.h" #include "genhdr/mpversion.h" @@ -148,8 +147,8 @@ STATIC mp_obj_t os_listdir(mp_uint_t n_args, const mp_obj_t *args) { if (sd_in_root()) { mp_obj_list_append(dir_list, MP_OBJ_NEW_QSTR(MP_QSTR_sd)); } - if (fs_user_mount != NULL) { - mp_obj_list_append(dir_list, mp_obj_new_str(fs_user_mount->str + 1, fs_user_mount->len - 1, false)); + if (MP_STATE_PORT(fs_user_mount) != NULL) { + mp_obj_list_append(dir_list, mp_obj_new_str(MP_STATE_PORT(fs_user_mount)->str + 1, MP_STATE_PORT(fs_user_mount)->len - 1, false)); } return dir_list; } -- cgit v1.2.3