diff --git a/rp2040-hal/src/i2c/controller/embassy_support.rs b/rp2040-hal/src/i2c/controller/embassy_support.rs index e1e81eb..4bfb2f1 100644 --- a/rp2040-hal/src/i2c/controller/embassy_support.rs +++ b/rp2040-hal/src/i2c/controller/embassy_support.rs @@ -7,7 +7,7 @@ impl, PINS> I2C { &mut self, mut buffer: Peekable, ) -> Result<(), Error> { - let first = true; + let mut first = true; while let Some(byte) = buffer.next() { let last = buffer.peek().is_none(); @@ -24,6 +24,7 @@ impl, PINS> I2C { self.i2c.ic_data_cmd.write(|w| { if first { w.restart().enable(); + first = false; } else { w.restart().disable(); }