-
Notifications
You must be signed in to change notification settings - Fork 152
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
Use critical_section
for Peripherals::take
.
#651
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @therealprof (or someone else) soon. Please see the contribution instructions for more information. |
fcb0914
to
bd33444
Compare
5584c86
to
28e0c54
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.
lgtm, this is great :D
do we need another reviewer maybe?
28e0c54
to
47b7679
Compare
I'm a bit concerned about what this means for platforms that don't have Having it as an optional dependency/feature seems useful though and does mean those platforms don't need immediate critical-section support, even end-users could add simple interrupt-based implementations to use |
I don't think it's worth waiting. Other architectures will have to implement these only once they upgrade |
Oh, thanks, I didn't see the edit to the first comment. SGTM to me then. |
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). | |||
|
|||
## [Unreleased] | |||
|
|||
- Use `critical_section::with` instead of `interrupt::free` for `Peripherals::take`. |
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.
A mention to take
not being provided if critical-section
is not enabled could probably be added here
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.
LGTM,too. Thanks a lot @reitermarkus for taking this on.
bors r+
770: Add `critical-section` feature. r=adamgreig a=reitermarkus Depends on rust-embedded/svd2rust#651. Co-authored-by: Markus Reiter <me@reitermark.us>
cortex_m
Add implementation for critical-section 1.0 cortex-m#447msp430
Providecritical_section
implementation. msp430#13riscv
Add critical-section 1.0 implementation, fix multicore unsoundness. riscv#110xtensa_lx
Correct Xtensa critical sections esp-rs/xtensa-lx#20,critical_section
implementations & esp_backtrace esp-rs/esp-hal#151mips_mcu
Providecritical_section
implementation. kiffie/pic32-rs#5