Skip to content

Commit

Permalink
Clear AFIFOs before transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominaezzz committed May 23, 2024
1 parent c19e6f7 commit a9a5d9b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,15 @@ where
.bit(is_high_part)
});

self.spi.register_block().dma_conf().modify(|_, w| {
w.rx_afifo_rst()
.set_bit()
.buf_afifo_rst()
.set_bit()
.dma_afifo_rst()
.set_bit()
});

self.spi.start_operation();

Ok(FifoTransfer { spi: self, fifo })
Expand Down Expand Up @@ -3217,6 +3226,15 @@ pub trait Instance: private::Sealed {

self.configure_datalen(data_len as u32 * 8);

self.register_block().dma_conf().modify(|_, w| {
w.rx_afifo_rst()
.set_bit()
.buf_afifo_rst()
.set_bit()
.dma_afifo_rst()
.set_bit()
});

self.start_operation();
}

Expand Down

0 comments on commit a9a5d9b

Please sign in to comment.