Skip to content

Commit

Permalink
fix SpiBus::transfer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
almindor committed Jun 23, 2022
1 parent 648aa58 commit c7e37ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spi/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ where
self.wait_for_rxfifo();

while iwrite < write.len() || iread < read.len() {
if iread < read.len() && self.spi.txdata.read().full().bit_is_clear() {
if iwrite < write.len() && self.spi.txdata.read().full().bit_is_clear() {
let byte = write.get(iwrite).unwrap_or(&0);
iwrite += 1;
self.spi.txdata.write(|w| unsafe { w.data().bits(*byte) });
Expand Down

0 comments on commit c7e37ab

Please sign in to comment.