mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 00:02:28 +00:00
Forward transaction() from blocking I2cDevice to underlying bus
This commit is contained in:
parent
7bf4710f3f
commit
d65724207d
@ -67,9 +67,11 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn transaction<'a>(&mut self, address: u8, operations: &mut [Operation<'a>]) -> Result<(), Self::Error> {
|
fn transaction<'a>(&mut self, address: u8, operations: &mut [Operation<'a>]) -> Result<(), Self::Error> {
|
||||||
let _ = address;
|
self.bus.lock(|bus| {
|
||||||
let _ = operations;
|
bus.borrow_mut()
|
||||||
todo!()
|
.transaction(address, operations)
|
||||||
|
.map_err(I2cDeviceError::I2c)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,8 +173,10 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn transaction<'a>(&mut self, address: u8, operations: &mut [Operation<'a>]) -> Result<(), Self::Error> {
|
fn transaction<'a>(&mut self, address: u8, operations: &mut [Operation<'a>]) -> Result<(), Self::Error> {
|
||||||
let _ = address;
|
self.bus.lock(|bus| {
|
||||||
let _ = operations;
|
let mut bus = bus.borrow_mut();
|
||||||
todo!()
|
bus.set_config(&self.config).map_err(|_| I2cDeviceError::Config)?;
|
||||||
|
bus.transaction(address, operations).map_err(I2cDeviceError::I2c)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user