Skip to content

Commit

Permalink
pybricks.tools: Run tasks while awaiting them.
Browse files Browse the repository at this point in the history
Previously, tasks were only driven by Bluetooth events
so timers would not work correctly.
  • Loading branch information
laurensvalk committed Oct 26, 2023
1 parent f5d0d81 commit a50ff18
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pybricks/tools/pb_module_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ STATIC bool pb_module_tools_pbio_task_test_completion(mp_obj_t obj, uint32_t end
pbio_task_t *task = MP_OBJ_TO_PTR(obj);

// Keep going if not done yet.
if (task->status == PBIO_ERROR_AGAIN) {
pbio_task_run_once(task);
}
if (task->status == PBIO_ERROR_AGAIN) {
return false;
}
Expand Down

0 comments on commit a50ff18

Please sign in to comment.