diff options
| author | elagil <[email protected]> | 2024-11-16 15:02:32 +0100 |
|---|---|---|
| committer | elagil <[email protected]> | 2024-11-16 15:02:32 +0100 |
| commit | d592875ca6d4df2b126e67603d32ed7f3e71910b (patch) | |
| tree | 04a86d83160817fa4f06f63a5cdb85886f320636 /embassy-stm32/src/dma | |
| parent | 6c4b3d82b637fce5ab6efdc312d7852381d8ddeb (diff) | |
fix(SAI): disallow start without initial write
Diffstat (limited to 'embassy-stm32/src/dma')
| -rw-r--r-- | embassy-stm32/src/dma/dma_bdma.rs | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/embassy-stm32/src/dma/dma_bdma.rs b/embassy-stm32/src/dma/dma_bdma.rs index cdc603e2c..08c7a5508 100644 --- a/embassy-stm32/src/dma/dma_bdma.rs +++ b/embassy-stm32/src/dma/dma_bdma.rs | |||
| @@ -828,7 +828,6 @@ impl<'a, W: Word> ReadableRingBuffer<'a, W> { | |||
| 828 | /// You must call this after creating it for it to work. | 828 | /// You must call this after creating it for it to work. |
| 829 | pub fn start(&mut self) { | 829 | pub fn start(&mut self) { |
| 830 | self.channel.start(); | 830 | self.channel.start(); |
| 831 | self.clear(); | ||
| 832 | } | 831 | } |
| 833 | 832 | ||
| 834 | /// Clear all data in the ring buffer. | 833 | /// Clear all data in the ring buffer. |
| @@ -981,7 +980,6 @@ impl<'a, W: Word> WritableRingBuffer<'a, W> { | |||
| 981 | /// You must call this after creating it for it to work. | 980 | /// You must call this after creating it for it to work. |
| 982 | pub fn start(&mut self) { | 981 | pub fn start(&mut self) { |
| 983 | self.channel.start(); | 982 | self.channel.start(); |
| 984 | self.clear(); | ||
| 985 | } | 983 | } |
| 986 | 984 | ||
| 987 | /// Clear all data in the ring buffer. | 985 | /// Clear all data in the ring buffer. |
| @@ -991,7 +989,6 @@ impl<'a, W: Word> WritableRingBuffer<'a, W> { | |||
| 991 | 989 | ||
| 992 | /// Write elements directly to the raw buffer. | 990 | /// Write elements directly to the raw buffer. |
| 993 | /// This can be used to fill the buffer before starting the DMA transfer. | 991 | /// This can be used to fill the buffer before starting the DMA transfer. |
| 994 | #[allow(dead_code)] | ||
| 995 | pub fn write_immediate(&mut self, buf: &[W]) -> Result<(usize, usize), Error> { | 992 | pub fn write_immediate(&mut self, buf: &[W]) -> Result<(usize, usize), Error> { |
| 996 | self.ringbuf.write_immediate(buf) | 993 | self.ringbuf.write_immediate(buf) |
| 997 | } | 994 | } |
