Skip to content

Commit

Permalink
Only flush if we need to read
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Sep 14, 2024
1 parent 871e630 commit 765a645
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2172,9 +2172,8 @@ mod ehal1 {
SpiBus::write(self, &write[write_from..write_to])?;
}

SpiBus::flush(self)?;

if read_inc > 0 {
SpiBus::flush(self)?;
self.spi
.read_bytes_from_fifo(&mut read[read_from..read_to])?;
}
Expand Down

0 comments on commit 765a645

Please sign in to comment.