-
Notifications
You must be signed in to change notification settings - Fork 22
task + async misc #67
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
Draft
d3zd3z
wants to merge
15
commits into
main
Choose a base branch
from
tasks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or 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
I'd like to start getting this ready for review. But, there is a question of how much this should be split apart. There are a few cherry-picked changes that are to be merged, so we'll at least wait for those to go in. |
2657f67
to
f90442b
Compare
cef1d3a
to
0f75e9e
Compare
Don't require that the two time bases be the same. This allows applications to work using the default embassy-time base of 1MHz. There is a performance cost to the conversion (which depends on the exact ratios). If the time bases are the same (which would be common for an application build for a single target), then no conversion is needed. Signed-off-by: David Brown <[email protected]>
Don't generate instance access code for DT nodes that aren't actually enabled. Signed-off-by: David Brown <[email protected]>
Add a short readme to explain some of the difficulties with level triggered interrupts (notably, most STM32 devices do not support level triggered interrupts). Signed-off-by: David Brown <[email protected]>
A version mismatch here causes compilation errors due to other crates depending on this specific version. Signed-off-by: David Brown <[email protected]>
Instead of allocating work queues, and hoping they don't get freed, instead move to a static declaration. This is facilitated by a macro `define_work_queue` that makes it easy to declare these at the top level. Signed-off-by: David Brown <[email protected]>
The docgen target seems to try building the docs before the generated headers are present. Work around this by making a full build first, and then generating the docs. Signed-off-by: David Brown <[email protected]>
The work-queue-based Future has been removed, so also removed the documentation that was describing it. Signed-off-by: David Brown <[email protected]>
Fix various broken links in documentation comments. Signed-off-by: David Brown <[email protected]>
Add some missing methods to `PinWeak`, notably forwarding `strong_count`, `weak_count`, and `ptr_eq` through to the inner type. Signed-off-by: David Brown <[email protected]>
After running the work queue benchmarks, ensure that we haven't leaked any Arcs. Signed-off-by: David Brown <[email protected]>
First step in generalizing the worker type. Place the inner pointer type into a trait, and allow the work methods to work on pointers of that type. This continues to work the same as before with `Pin<Arc<Work<T>>>`. It needs a bit more massaging to be able to work with static pointers, namely that the constructor has to be able to be static, and as such, the initialization can't happen until it has been pinned down. This will likely change the "new" API. Signed-off-by: David Brown <[email protected]>
The ZephyrObject pairs the UnsafeCell with an atomic for initialization that allows for const constructors. Signed-off-by: David Brown <[email protected]>
Instead of hard-coding `Pin<Arc<Work<T>>>`, have a constructor that wraps the `Arc<Work<T>>` in a new type `ArcWork`. This has the methods for submitting work on this particular pointer type. This leaves room for `StaticWork` which will have a static reference. Removes all references to Pin. Now that the Work queue itself is stored in a ZephyrObject, we have a mechanism to panic on move, which although a runtime check, does catch issues where values have been moved. Signed-off-by: David Brown <[email protected]>
Support enqueueing &'static Work as well as the Arc-based work. Signed-off-by: David Brown <[email protected]>
Clean up formatting Signed-off-by: David Brown <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Create a new proc-macro-based way of declaring threads in Zephyr. Instead of the weird
kobj_define
macro, provide azephyr::thread
macro that can decorate an ordinary Rust function to become a builder for aReadyThread
that can just be started. Threads can also now be reused after they exit.This allows something like:
and somewhere in the code, you just call it, which returns a handle that can be used to start the thread.
There is still some things to clean up, hence the draft, but I wanted to get some exposure.