Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pybricks.tools.run_task: call MICROPY_VM_HOOK_LOOP
Since removing the gc_collect() from the run_task() loop, when setting loop_time_ms to 0, it was possible that the contiki events were never getting handled, causing random crashes due to watchdog timeout or UART device failure. This adds MICROPY_VM_HOOK_LOOP in the loop to ensure that background events are always being handled even when running in a tight loop. Fixes: 5a0c7d5 ("pybricks/tools/pb_module_tools: remove gc_collect() from run loop")
- Loading branch information
Should this not be
MICROPY_EVENT_POLL_HOOK
? We want to be able to handle a pendingSystemExit
, for example.Or perhaps rather add
mp_handle_pending(true);
since we don't necessarily want to__WFI
?