Skip to content

Commit 2001114

Browse files
committed
Always stop after reading.
For some reason suspending causes subsequent reads to overrun.
1 parent f96389a commit 2001114

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

nrf-hal-common/src/twim.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,13 +425,10 @@ where
425425
compiler_fence(SeqCst);
426426
unsafe { self.set_rx_buffer(buffer)? };
427427

428-
// Set appropriate lastrx shortcut.
429-
if next_operation_write.is_none() {
430-
self.0.shorts.write(|w| w.lastrx_stop().enabled());
431-
} else {
432-
#[cfg(not(any(feature = "5340-app", feature = "5340-net", feature = "52832")))]
433-
self.0.shorts.write(|w| w.lastrx_suspend().enabled());
434-
}
428+
// TODO: We should suspend rather than stopping if there are more operations to
429+
// follow, but for some reason that results in an overrun error and reading bad
430+
// data in the next read.
431+
self.0.shorts.write(|w| w.lastrx_stop().enabled());
435432

436433
// Start read.
437434
self.0.tasks_startrx.write(|w| unsafe { w.bits(1) });

0 commit comments

Comments
 (0)