Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
os_listdir: This can be long-running, run background tasks
While finding sources of clicks and buzzes in nrf i2sout, I identified
this site as one which could be long running.  Reproducer code was to
play a 22.05kHz sample and repeatedly print `os.listdir('')`
  • Loading branch information
jepler committed Sep 10, 2019
commit 676f7aa80821aa681030a5c43ce7e6c03b65241b
1 change: 1 addition & 0 deletions shared-module/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ mp_obj_t common_hal_os_listdir(const char* path) {
while ((next = mp_iternext(iter_obj)) != MP_OBJ_STOP_ITERATION) {
// next[0] is the filename.
mp_obj_list_append(dir_list, mp_obj_subscr(next, MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_SENTINEL));
RUN_BACKGROUND_TASKS;
}
return dir_list;
}
Expand Down