-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multitasking #166
Merged
Merged
Multitasking #166
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
541f349
pybricks.tools: Add _set_run_loop_active().
laurensvalk 49f453e
pybricks.common.Motor: Return generator object in run loop.
dlech 8981245
pybricks.common.Motor: Async run_until_stalled.
laurensvalk 07f0f9c
pybricks.common.Motor: Use generator for blocking run_until_stalled.
laurensvalk 02fe7fc
pybricks.common.Motor: Move pb_type_MotorWait_obj_t.
laurensvalk ec73534
pybricks.common.Motor: Recycle free generators.
laurensvalk 235d901
pybricks.common.Motor: Cancel ongoing generators on new task.
laurensvalk b0c2305
pybricks.common.Motor: Cancel ongoing generators on new non-blocking …
laurensvalk 451115e
pybricks.tools: Make wait awaitable in run loop.
laurensvalk e5ca655
pybricks.robotics.DriveBase: Support run loop.
laurensvalk db707ed
pybricks.tools: Make wait reusable.
laurensvalk cd73dd5
pybricks.tools: Generalize await with callback.
laurensvalk aa04f53
pybricks.common.Speaker: Make beep awaitable.
laurensvalk 78b9561
bricks/_common/modules: Add multi-tasking module.
laurensvalk 31145b4
pybricks.tools: Import task from tools.
laurensvalk b93ca4b
bricks/virtualhub: Add async demo and test.
laurensvalk 6375661
pybricks.tools.task: implement all() and race()
dlech 497312f
pybricks.tools: Generalize awaitable.
laurensvalk 9f23f0a
pybricks.tools: Use new awaitable for wait.
laurensvalk 4e5706b
pybricks.tools: Use new awaitable for Motor.
laurensvalk e287f71
pybricks.tools: Use new awaitable for DriveBase.
laurensvalk 4e8505d
pybricks.tools: Use new awaitable for beep.
laurensvalk d674b8d
pybricks.tools: Restore cancel handling on exception.
laurensvalk 97d0f9d
pybricks.common.speaker: Make play_notes awaitable.
laurensvalk ee83f9c
pybricks.tools: Delete type_wait.
laurensvalk 5689ed0
pybricks.tools.task: Add empty module and disable Python module.
laurensvalk a2f401e
pybricks.tools.task: Implement in C.
laurensvalk 7ae0dcf
pybricks/tools/pb_type_awaitable: Refactor.
laurensvalk e11f4fe
pybricks.tools: Task is a type.
laurensvalk c9055bb
pybricks.tools.Task: Rename to multitask.
laurensvalk e4d04c7
pbio/control: Set temporary limits via pbio.
laurensvalk 126c172
pbio/drivebase: Use function call to check for active.
laurensvalk eacf883
pbio/control: Fix control type enum names.
laurensvalk 11ce5b7
pbio/control: Generalize control type.
laurensvalk 80b8f83
pbio/control: Add stalling as control objective.
laurensvalk 4040fe1
pbio/servo: Implement run_until_stalled.
laurensvalk d53c300
pbio/control: Add stalling as completion option.
laurensvalk 236e21b
pybricks.common.Motor: Update run_until_stall.
laurensvalk 93b15c7
pybricks/tools/pb_type_awaitable: Generalize return value.
laurensvalk 87d9ab0
pybricks/tools/pb_type_awaitable: Simplify blocking call.
laurensvalk f961d55
pybricks.common.Motor: Drop temporary stall states.
laurensvalk 994e72a
pybricks/tools/pb_type_awaitable: Drop config struct.
laurensvalk 692df86
pybricks/tools/pb_type_awaitable: Fix allocation of first awaitable.
laurensvalk b758ac1
pybricks/tools/pb_type_awaitable: Fix cancellation of linked objects.
laurensvalk cd7304a
pybricks/tools/pb_type_awaitable: Use mp_obj_list_t instead of our ow…
laurensvalk 8893a42
pybricks/tools/pb_type_awaitable: Generalize object type.
laurensvalk 9c910ea
pybricks/tools/pb_type_awaitable: Refactor options.
laurensvalk 54db661
pybricks/tools/pb_type_awaitable: Add force block option.
laurensvalk c62b0a9
pybricks/tools/pb_type_awaitable: Use end time.
laurensvalk 1f7e87f
pybricks.common.ColorLight: Callbacks return objects.
laurensvalk 7e3a73f
pybricks/tools/pb_type_awaitable: Share blocking assert.
laurensvalk 019ed1e
pybricks.common.Motor: Restore duty_limit behavior.
laurensvalk 6f099d2
.vscode/tasks: Add build task for Move Hub.
laurensvalk 65cbbec
pybricks/tools/pb_type_awaitable: Revert generalizing object type.
laurensvalk 54408e9
pbio/uartdev: Fix port_data not being static.
laurensvalk e8651fa
pybricks/pupdevices: Make sensors async-ready.
laurensvalk 3cf50b3
pybricks/tools/awaitable: Refactor cancel_all.
laurensvalk 3afe954
pybricks/tools/awaitable: Add raise on busy option.
laurensvalk 4b939b0
pybricks.common.Speaker: Fix awaitable.
laurensvalk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
pybricks/tools/pb_type_awaitable: Simplify blocking call.
With the return value available separately, we can get it directly instead of through iterating. This reinstates behavior close to the way it was before introducing async, in an effort not to reduce performance in the normal use case.
- Loading branch information
commit 87d9ab099136119ecedc7857bace1684c4af8e6d
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 On ev3dev (at least with the current implementation) we need a delay here. But in general,
MICROPY_EVENT_POLL_HOOK
would be more appropriate here.