Skip to content
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

Merge spi ExclusiveDevice implementations #477

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Jul 18, 2023

As a somewhat counter-proposal to #474 this PR merges the two different ExclusiveDevice implementations. I don't think there is any need in keeping them separate, especially when the async version implements the blocking SpiDevice trait. The separation also meant that bus access was implemented for the async version, but not the blocking-only one. This has now been fixed.

@bugadani bugadani requested a review from a team as a code owner July 18, 2023 20:50
@bugadani bugadani changed the title Merge spi ExclusiveDevice implementations Merge spi ExclusiveDevice implementations, implement async DelayUs for NoDelay Jul 18, 2023
@bugadani bugadani changed the title Merge spi ExclusiveDevice implementations, implement async DelayUs for NoDelay Merge spi ExclusiveDevice implementations Jul 18, 2023
Copy link
Member

@Dirbaio Dirbaio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it makes more sense this way, yes.

My reasoning to make a separate asynch module was that we'll likely add async versions of the shared bus adapters. For those it's harder to make the same adapter implement both blocking and async (Tokio can thanks to std threads, but embassy-sync, rtic-sync can't). However there's no "standard" async mutex currently so perhaps that's best to ecosystem crates (like embassy-embedded-hal for example)

@Dirbaio Dirbaio added this pull request to the merge queue Jul 19, 2023
Merged via the queue into rust-embedded:master with commit a94b507 Jul 19, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants