Skip to content

Commit

Permalink
i2c: Set ack bit on multibyte reads
Browse files Browse the repository at this point in the history
Enable the ack bit on multibyte (>2) reads otherwise bytes from the
remote device are not acknowledged.

Signed-off-by: Sjoerd Simons <sjoerd@luon.net>
  • Loading branch information
sjoerdsimons committed Nov 3, 2020
1 parent a1d8b24 commit 765ac49
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 765ac49

Please sign in to comment.