summaryrefslogtreecommitdiff
path: root/stmhal/moduos.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-07-27 23:52:56 +0100
committerDamien George <damien.p.george@gmail.com>2015-07-27 23:52:56 +0100
commitf5d04750dbd13bfc10498e20428b1a285ec417af (patch)
tree819b5723bff4db7cb9f5f147f403430b7c40fa55 /stmhal/moduos.c
parent92e9a5e0a7f2634c670ffe8056430b94d210a4c0 (diff)
stmhal: Put fs_user_mount pointer in root ptr section of global state.
Should fix issue #1393.
Diffstat (limited to 'stmhal/moduos.c')
-rw-r--r--stmhal/moduos.c7
1 files changed, 3 insertions, 4 deletions
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 <stdint.h>
#include <string.h>
-#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;
}