-
Notifications
You must be signed in to change notification settings - Fork 201
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
Add embedded-hal-bus atomic-device features #607
Add embedded-hal-bus atomic-device features #607
Conversation
CI errors, because |
perhaps we can instead do the following:
Advantages
|
Certainly looks cleaner @Dirbaio. I've also added |
embedded-hal-bus/Cargo.toml
Outdated
@@ -26,7 +36,7 @@ embedded-hal = { version = "1.0.0", path = "../embedded-hal" } | |||
embedded-hal-async = { version = "1.0.0", path = "../embedded-hal-async", optional = true } | |||
critical-section = { version = "1.0" } | |||
defmt-03 = { package = "defmt", version = "0.3", optional = true } | |||
portable-atomic = {version = "1", default-features = false} | |||
portable-atomic = {version = "1.3", default-features = false, features = ["require-cas"]} |
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.
doesn't this need optional = true
? otherwise thumbv6 build will fail due to require-cas
being enabled if the user doesn't enable any of the features for portable-atomic
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.
You are correct.
I've now made portable-atomic optional and done the cleanup required to handle building without it enabled.
I've tested the following on a thumbv6 target:
- feature disabled - build success, AtomicCell, {spi,i2c}::AtomicDevice not present in docs
- feature enabled, no polyfill set - link error shown above
- feature enabled, portable-atomic/unsafe-assume-single-core - build success, AtomicCell, {spi,i2c}::AtomicDevice present in docs
4eb0ee6
to
b556544
Compare
b556544
to
2acbd77
Compare
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.
thank you!
Add atomic-device and portable-atomic features as described in this comment
The tasks from the comment are copied below for convenience
Note that the entire util.rs module is only ever used by AtomicDevice and the i2c/spi atomic impls, so we could sensibly rename it to atomic_util.rs and gate that that file instead of everything defined inside it.
Note: untested at this point. Will add comment once testing is done.
Resolves #598