Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adopt type states to manage bus sharing
In rust-embedded/embedded-hal#35 one of the proposals for dealing with sharing the buses is to use this pattern. The most appealing aspect of this is that it doesn't require any specific knowledge of synchronization or concurrency used by the embedding application. The `Owned::borrow` method feels a little warty and un-ergonomic. Ideally we'd be able to use `Deref` and `DerefMut` to have the compiler automatically `borrow()` when doing something like `owned.get_bank_a_data()`, but it doesn't appear to be possible to have it meet our lifetime requirements.
- Loading branch information
Showing
1 changed file
with
108 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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