Merge pull request #4487 from pperanich/shared-i2c-remove-static

fix: remove static lifetime requirements from i2c shared bus.
This commit is contained in:
Dario Nieuwenhuis 2025-07-31 22:09:21 +00:00 committed by GitHub
commit 6409931ef9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,8 +50,8 @@ where
impl<M, BUS> i2c::I2c for I2cDevice<'_, M, BUS>
where
M: RawMutex + 'static,
BUS: i2c::I2c + 'static,
M: RawMutex,
BUS: i2c::I2c,
{
async fn read(&mut self, address: u8, read: &mut [u8]) -> Result<(), I2cDeviceError<BUS::Error>> {
let mut bus = self.bus.lock().await;
@ -124,8 +124,8 @@ where
impl<M, BUS> i2c::I2c for I2cDeviceWithConfig<'_, M, BUS>
where
M: RawMutex + 'static,
BUS: i2c::I2c + SetConfig + 'static,
M: RawMutex,
BUS: i2c::I2c + SetConfig,
{
async fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), I2cDeviceError<BUS::Error>> {
let mut bus = self.bus.lock().await;