mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 06:40:32 +00:00
Merge pull request #4487 from pperanich/shared-i2c-remove-static
fix: remove static lifetime requirements from i2c shared bus.
This commit is contained in:
commit
6409931ef9
@ -50,8 +50,8 @@ where
|
|||||||
|
|
||||||
impl<M, BUS> i2c::I2c for I2cDevice<'_, M, BUS>
|
impl<M, BUS> i2c::I2c for I2cDevice<'_, M, BUS>
|
||||||
where
|
where
|
||||||
M: RawMutex + 'static,
|
M: RawMutex,
|
||||||
BUS: i2c::I2c + 'static,
|
BUS: i2c::I2c,
|
||||||
{
|
{
|
||||||
async fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), I2cDeviceError<BUS::Error>> {
|
async fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), I2cDeviceError<BUS::Error>> {
|
||||||
let mut bus = self.bus.lock().await;
|
let mut bus = self.bus.lock().await;
|
||||||
@ -124,8 +124,8 @@ where
|
|||||||
|
|
||||||
impl<M, BUS> i2c::I2c for I2cDeviceWithConfig<'_, M, BUS>
|
impl<M, BUS> i2c::I2c for I2cDeviceWithConfig<'_, M, BUS>
|
||||||
where
|
where
|
||||||
M: RawMutex + 'static,
|
M: RawMutex,
|
||||||
BUS: i2c::I2c + SetConfig + 'static,
|
BUS: i2c::I2c + SetConfig,
|
||||||
{
|
{
|
||||||
async fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), I2cDeviceError<BUS::Error>> {
|
async fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), I2cDeviceError<BUS::Error>> {
|
||||||
let mut bus = self.bus.lock().await;
|
let mut bus = self.bus.lock().await;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user