diff options
| author | elagil <[email protected]> | 2025-08-25 21:10:59 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-09-05 14:43:29 +0200 |
| commit | be881875917b93a8cdb7a4ab07876e1239fbe1be (patch) | |
| tree | b6fea453734b6c1f2a9046804984e7b15533cbcf | |
| parent | f0fc1a15da774f2cc6338697e40f9d1fc7975eb5 (diff) | |
fix: transfer options
| -rw-r--r-- | embassy-stm32/src/dma/gpdma/mod.rs | 3 | ||||
| -rw-r--r-- | embassy-stm32/src/dma/gpdma/ringbuffered.rs | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/embassy-stm32/src/dma/gpdma/mod.rs b/embassy-stm32/src/dma/gpdma/mod.rs index 1d2811ab4..b23c22dfb 100644 --- a/embassy-stm32/src/dma/gpdma/mod.rs +++ b/embassy-stm32/src/dma/gpdma/mod.rs | |||
| @@ -283,6 +283,9 @@ impl AnyChannel { | |||
| 283 | state.lli_state.transfer_count.store(0, Ordering::Relaxed) | 283 | state.lli_state.transfer_count.store(0, Ordering::Relaxed) |
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | /// Configure a linked-list transfer. | ||
| 287 | /// | ||
| 288 | /// Transfer options apply only to the base register transfer, not the linked-list items. | ||
| 286 | unsafe fn configure_linked_list<const ITEM_COUNT: usize>( | 289 | unsafe fn configure_linked_list<const ITEM_COUNT: usize>( |
| 287 | &self, | 290 | &self, |
| 288 | table: &Table<ITEM_COUNT>, | 291 | table: &Table<ITEM_COUNT>, |
diff --git a/embassy-stm32/src/dma/gpdma/ringbuffered.rs b/embassy-stm32/src/dma/gpdma/ringbuffered.rs index 6bd48258b..a5b127d08 100644 --- a/embassy-stm32/src/dma/gpdma/ringbuffered.rs +++ b/embassy-stm32/src/dma/gpdma/ringbuffered.rs | |||
| @@ -69,6 +69,8 @@ pub struct ReadableRingBuffer<'a, W: Word> { | |||
| 69 | 69 | ||
| 70 | impl<'a, W: Word> ReadableRingBuffer<'a, W> { | 70 | impl<'a, W: Word> ReadableRingBuffer<'a, W> { |
| 71 | /// Create a new ring buffer. | 71 | /// Create a new ring buffer. |
| 72 | /// | ||
| 73 | /// Transfer options are applied to the individual linked list items. | ||
| 72 | pub unsafe fn new( | 74 | pub unsafe fn new( |
| 73 | channel: impl Peripheral<P = impl Channel> + 'a, | 75 | channel: impl Peripheral<P = impl Channel> + 'a, |
| 74 | request: Request, | 76 | request: Request, |
| @@ -220,6 +222,8 @@ pub struct WritableRingBuffer<'a, W: Word> { | |||
| 220 | 222 | ||
| 221 | impl<'a, W: Word> WritableRingBuffer<'a, W> { | 223 | impl<'a, W: Word> WritableRingBuffer<'a, W> { |
| 222 | /// Create a new ring buffer. | 224 | /// Create a new ring buffer. |
| 225 | /// | ||
| 226 | /// Transfer options are applied to the individual linked list items. | ||
| 223 | pub unsafe fn new( | 227 | pub unsafe fn new( |
| 224 | channel: impl Peripheral<P = impl Channel> + 'a, | 228 | channel: impl Peripheral<P = impl Channel> + 'a, |
| 225 | request: Request, | 229 | request: Request, |
| @@ -279,7 +283,7 @@ impl<'a, W: Word> WritableRingBuffer<'a, W> { | |||
| 279 | self.channel.configure_linked_list( | 283 | self.channel.configure_linked_list( |
| 280 | &self.table, | 284 | &self.table, |
| 281 | TransferOptions { | 285 | TransferOptions { |
| 282 | half_transfer_ir: true, | 286 | half_transfer_ir: false, |
| 283 | complete_transfer_ir: true, | 287 | complete_transfer_ir: true, |
| 284 | ..Default::default() | 288 | ..Default::default() |
| 285 | }, | 289 | }, |
