mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2024-12-23 20:51:31 +11:00
embassy-traits: Fix unexpected restart on repeated read.
This commit is contained in:
parent
ce7c9f4be3
commit
7840d0f833
|
@ -7,7 +7,7 @@ impl<T: Deref<Target = Block>, PINS> I2C<T, PINS, Controller> {
|
|||
&mut self,
|
||||
mut buffer: Peekable<U>,
|
||||
) -> 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<T: Deref<Target = Block>, PINS> I2C<T, PINS, Controller> {
|
|||
self.i2c.ic_data_cmd.write(|w| {
|
||||
if first {
|
||||
w.restart().enable();
|
||||
first = false;
|
||||
} else {
|
||||
w.restart().disable();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue