-
Notifications
You must be signed in to change notification settings - Fork 34
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
Replace specific proxy types I2cProxy and AdcProxy by generic type Proxy #25
base: main
Are you sure you want to change the base?
Conversation
Please read #8 for why this is necessary right now. This is also essentially the reason why we currently have different types for each bus - as you noticed this wouldn't be necessary if they are all the same. I have plans on how to build a better solution for this, but this is still in the works... |
I have understood that the Still, I do not see the use of the |
Ah, sorry, I did not see this during my initial read through your changeset. Joining just the "good" proxies is okay. However, we should really keep the old names available as to not require a breaking release. Please add type-aliases for
That's what makes the |
…uire_adc method aliases; clean up documentation
Sounds reasonable, done in the commit before
I suspected this was the intention. But I guess it is not required because the impl<T> BusManager<crate::NullMutex<T>> {
pub fn acquire_spi<'a>(&'a self) -> crate::SpiProxy<'a, crate::NullMutex<T>> {
crate::SpiProxy {
mutex: &self.mutex,
}
}
} So there will only ever be // from the docs
impl<'a, M> Send for SpiProxy<'a, M>
where
M: Sync
impl<'a, M> Sync for SpiProxy<'a, M>
where
M: Sync, and the |
I have seen that the different proxy types (
I2cProxy
,SpiProxy
andAdcProxy
) are essentially the same types. The only difference for theSpiProxy
is that should only be initialized with theNullMutex
. So I guess this can be reduced to only two types there.Also, the
SpiProxy::_u
field had no apparent use so I removed it. Have I overlooked something there?This is WIP because I have not adjusted the documentation and removed the
acquire_adc
method yet.