-
Notifications
You must be signed in to change notification settings - Fork 200
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
e-h-bus: Adding AtomicDevice
for I2C and SPI bus sharing in multiple interrupt contexts
#579
Conversation
} | ||
} | ||
|
||
unsafe impl<'a, T> Send for AtomicDevice<'a, T> {} |
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.
I would expect this to be impl Sync
, but for some reason if I only do Sync, my test application complains that the AtomicDevice
cannot be shared across threads safely.
AtomicDevice
for I2C and SPI bus sharing in multiple interrupt contexts
you didn't check "allow maintainers to push", i've pushed some fixes to #593 |
Thanks for taking this over and pushing it through! :) I didn't see the maintainer allow button, my bad. |
This PR adds a primitive for sharing an I2C or SPI bus across multiple threads where the synchronization scheme is managed externally (i.e. RTIC sync resources).
The user is returned an
Error::Busy
if they ever attempt to pre-empt usage of the bus.CC @Dirbaio as we were talking about this in the Matrix channel yesterday.