Skip to content

Commit

Permalink
fix?: insert deplay nop between DMA and SPI
Browse files Browse the repository at this point in the history
Prior to this commit, LLVM would have to de-optimize a little bit from
its theoretical best, lest we fall off the edge of whatever timing
boundary we're running into.

For more information, see: esp-rs#489
  • Loading branch information
sethp committed Apr 24, 2023
1 parent 38a7eda commit d8ae60a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions esp-hal-common/src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,9 @@ where
reset_dma_before_load_dma_dscr(reg_block);
tx.prepare_transfer(self.dma_peripheral(), false, ptr, len)?;

// critical load-bearing nop, see https://github.com/esp-rs/esp-hal/issues/489
unsafe { core::arch::asm!("nop") }

self.clear_dma_interrupts();
reset_dma_before_usr_cmd(reg_block);

Expand Down

0 comments on commit d8ae60a

Please sign in to comment.