From 765ac4955768cc43dd19a93108c6a66198e60c87 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sun, 1 Nov 2020 22:25:48 +0100 Subject: [PATCH] i2c: Set ack bit on multibyte reads Enable the ack bit on multibyte (>2) reads otherwise bytes from the remote device are not acknowledged. Signed-off-by: Sjoerd Simons --- src/i2c.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/i2c.rs b/src/i2c.rs index a0b0c7d2..ca835710 100644 --- a/src/i2c.rs +++ b/src/i2c.rs @@ -533,6 +533,7 @@ where self.nb.i2c.cr1.modify(|_, w| w.ack().set_bit()); } buffer_len => { + self.nb.i2c.cr1.modify(|_, w| w.ack().set_bit()); self.nb.i2c.sr1.read(); self.nb.i2c.sr2.read();