Add more memory barriers to avoid code re-ordering issues with DMA (#155)
* Add more memory barriers to avoid code re-ordering issues with DMA * Comment typos * Fix Wstrict-prototype on __compiler_memory_barrier * Remove now-redundant __compiler_barrier macro from hardware_flash Co-authored-by: Luke Wren <wren6991@gmail.com>
This commit is contained in:
committed by
graham sanderson
parent
4b7ffd71f0
commit
0732d0c2a3
@ -540,6 +540,8 @@ inline static bool dma_channel_is_busy(uint channel) {
|
||||
*/
|
||||
inline static void dma_channel_wait_for_finish_blocking(uint channel) {
|
||||
while (dma_channel_is_busy(channel)) tight_loop_contents();
|
||||
// stop the compiler hoisting a non volatile buffer access above the DMA completion.
|
||||
__compiler_memory_barrier();
|
||||
}
|
||||
|
||||
/*! \brief Enable the DMA sniffing targeting the specified channel
|
||||
|
Reference in New Issue
Block a user