summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/moduos.c
diff options
context:
space:
mode:
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 55404c77bd..4a8261e41f 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;
}