mirror of
https://github.com/PSenfft/mb85rc.git
synced 2025-08-24 21:34:16 +00:00
fixed changed function interface in embedded_io
This commit is contained in:
parent
11b10b53e8
commit
54d35ebbec
@ -27,10 +27,11 @@ impl<T: I2c> ErrorType for EmbedIODev<T> {
|
|||||||
impl<T: I2c> Read for EmbedIODev<T> {
|
impl<T: I2c> Read for EmbedIODev<T> {
|
||||||
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
|
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
|
||||||
self.dev
|
self.dev
|
||||||
.sequential_read(self.head.memory_address().unwrap(), buf)
|
.sequential_read(&self.head.memory_address().unwrap(), buf)
|
||||||
.map_err(MB85RCErrorType::I2c)
|
.map_err(MB85RCErrorType::I2c)
|
||||||
.inspect(|read_bytes| {
|
.map(|_| {
|
||||||
self.head.advance(*read_bytes);
|
self.head.advance(buf.len());
|
||||||
|
buf.len()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user