From 745d618ab7f40f518c25d8db2116cfd774c16623 Mon Sep 17 00:00:00 2001 From: eZio Pan Date: Thu, 21 Dec 2023 16:59:20 +0800 Subject: [PATCH] note on circular mode DMA --- embassy-stm32/src/dma/bdma.rs | 4 ++++ embassy-stm32/src/dma/dma.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/embassy-stm32/src/dma/bdma.rs b/embassy-stm32/src/dma/bdma.rs index 2f37b1edf..a2b83716d 100644 --- a/embassy-stm32/src/dma/bdma.rs +++ b/embassy-stm32/src/dma/bdma.rs @@ -23,6 +23,10 @@ use crate::pac::bdma::{regs, vals}; #[non_exhaustive] pub struct TransferOptions { /// Enable circular DMA + /// + /// Note: + /// If you enable circular mode manually, you may want to build and `.await` the `Transfer` in a separate task. + /// Since DMA in circular mode need manually stop, `.await` in current task would block the task forever. pub circular: bool, /// Enable half transfer interrupt pub half_transfer_ir: bool, diff --git a/embassy-stm32/src/dma/dma.rs b/embassy-stm32/src/dma/dma.rs index 9b47ca5c3..16d02f273 100644 --- a/embassy-stm32/src/dma/dma.rs +++ b/embassy-stm32/src/dma/dma.rs @@ -30,6 +30,10 @@ pub struct TransferOptions { /// FIFO threshold for DMA FIFO mode. If none, direct mode is used. pub fifo_threshold: Option, /// Enable circular DMA + /// + /// Note: + /// If you enable circular mode manually, you may want to build and `.await` the `Transfer` in a separate task. + /// Since DMA in circular mode need manually stop, `.await` in current task would block the task forever. pub circular: bool, /// Enable half transfer interrupt pub half_transfer_ir: bool,