Skip to content

Commit

Permalink
pybricks.common.Logger: Call event poll hook on save.
Browse files Browse the repository at this point in the history
When the hub is not connected, it will still try to output
all the data, so we need to make sure that system resources
get some time while that happens.

Fixes: pybricks/support#738
  • Loading branch information
laurensvalk committed Oct 18, 2022
1 parent 8dbf31f commit 954f884
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pybricks/common/pb_type_logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ STATIC mp_obj_t tools_Logger_save(size_t n_args, const mp_obj_t *pos_args, mp_ma
mp_print_str(&mp_plat_print, row_str);
#endif // PYBRICKS_PY_COMMON_LOGGER_REAL_FILE

// Writing data can take a while, so give MicroPython some time too
mp_handle_pending(true);
// Writing data can take a while, so give other resources some time too
MICROPY_EVENT_POLL_HOOK;
}

#if PYBRICKS_PY_COMMON_LOGGER_REAL_FILE
Expand Down

0 comments on commit 954f884

Please sign in to comment.