diff options
| author | etiennecollin <[email protected]> | 2025-08-25 21:10:59 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-09-05 14:43:29 +0200 |
| commit | a2daa9739f375301425a4581601b65470ba5f459 (patch) | |
| tree | 0b66990354a45d6aa543a776e8856c9bcf407b0a | |
| parent | 2f24568de08e846d4bfafff90a5b9ba352d86431 (diff) | |
fix: removed functions exposing channel registers
These functions could be used to cause UB.
| -rw-r--r-- | embassy-stm32/src/dma/gpdma/mod.rs | 5 | ||||
| -rw-r--r-- | embassy-stm32/src/dma/gpdma/ringbuffered.rs | 16 |
2 files changed, 0 insertions, 21 deletions
diff --git a/embassy-stm32/src/dma/gpdma/mod.rs b/embassy-stm32/src/dma/gpdma/mod.rs index 58f93ffb0..4893fed94 100644 --- a/embassy-stm32/src/dma/gpdma/mod.rs +++ b/embassy-stm32/src/dma/gpdma/mod.rs | |||
| @@ -374,11 +374,6 @@ impl AnyChannel { | |||
| 374 | .store(table.transfer_count(), Ordering::Relaxed) | 374 | .store(table.transfer_count(), Ordering::Relaxed) |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | fn get_dma_channel(&self) -> pac::gpdma::Channel { | ||
| 378 | let info = self.info(); | ||
| 379 | info.dma.ch(info.num) | ||
| 380 | } | ||
| 381 | |||
| 382 | fn start(&self) { | 377 | fn start(&self) { |
| 383 | let info = self.info(); | 378 | let info = self.info(); |
| 384 | let ch = info.dma.ch(info.num); | 379 | let ch = info.dma.ch(info.num); |
diff --git a/embassy-stm32/src/dma/gpdma/ringbuffered.rs b/embassy-stm32/src/dma/gpdma/ringbuffered.rs index dfc031627..3a7ceb292 100644 --- a/embassy-stm32/src/dma/gpdma/ringbuffered.rs +++ b/embassy-stm32/src/dma/gpdma/ringbuffered.rs | |||
| @@ -96,14 +96,6 @@ impl<'a, W: Word> ReadableRingBuffer<'a, W> { | |||
| 96 | self.channel.start(); | 96 | self.channel.start(); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | /// Get a handle to the GPDMA channel for configuring the DMA. | ||
| 100 | /// | ||
| 101 | /// Usually, **this is not needed** as a default configuration is already | ||
| 102 | /// applied, but it may be useful to setup trigger sources, etc. | ||
| 103 | pub fn get_dma_channel(&mut self) -> stm32_metapac::gpdma::Channel { | ||
| 104 | self.channel.get_dma_channel() | ||
| 105 | } | ||
| 106 | |||
| 107 | /// Clear all data in the ring buffer. | 99 | /// Clear all data in the ring buffer. |
| 108 | pub fn clear(&mut self) { | 100 | pub fn clear(&mut self) { |
| 109 | self.ringbuf.reset(&mut DmaCtrlImpl(self.channel.reborrow())); | 101 | self.ringbuf.reset(&mut DmaCtrlImpl(self.channel.reborrow())); |
| @@ -258,14 +250,6 @@ impl<'a, W: Word> WritableRingBuffer<'a, W> { | |||
| 258 | self.channel.start(); | 250 | self.channel.start(); |
| 259 | } | 251 | } |
| 260 | 252 | ||
| 261 | /// Get a handle to the GPDMA channel for configuring the DMA. | ||
| 262 | /// | ||
| 263 | /// Usually, **this is not needed** as a default configuration is already | ||
| 264 | /// applied, but it may be useful to setup trigger sources, etc. | ||
| 265 | pub fn get_dma_channel(&mut self) -> stm32_metapac::gpdma::Channel { | ||
| 266 | self.channel.get_dma_channel() | ||
| 267 | } | ||
| 268 | |||
| 269 | /// Clear all data in the ring buffer. | 253 | /// Clear all data in the ring buffer. |
| 270 | pub fn clear(&mut self) { | 254 | pub fn clear(&mut self) { |
| 271 | self.ringbuf.reset(&mut DmaCtrlImpl(self.channel.reborrow())); | 255 | self.ringbuf.reset(&mut DmaCtrlImpl(self.channel.reborrow())); |
