Replace specific proxy types I2cProxy and AdcProxy by generic type Proxy#25
Replace specific proxy types I2cProxy and AdcProxy by generic type Proxy#25DrTobe wants to merge 3 commits into
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,SpiProxyandAdcProxy) are essentially the same types. The only difference for theSpiProxyis that should only be initialized with theNullMutex. So I guess this can be reduced to only two types there.Also, the
SpiProxy::_ufield 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_adcmethod yet.