diff --git a/embassy-stm32/src/dma/ringbuffer.rs b/embassy-stm32/src/dma/ringbuffer.rs index c3e4f20c..945c7508 100644 --- a/embassy-stm32/src/dma/ringbuffer.rs +++ b/embassy-stm32/src/dma/ringbuffer.rs @@ -229,14 +229,6 @@ impl<'a, W: Word> WritableDmaRingBuffer<'a, W> { pub fn write(&mut self, mut dma: impl DmaCtrl, buf: &[W]) -> Result<(usize, usize), OverrunError> { let start = self.pos(dma.get_remaining_transfers()); if start > self.end { - trace!( - "[1]: start, end, len, complete_count: {}, {}, {}, {}", - start, - self.end, - buf.len(), - dma.get_complete_count() - ); - // The occupied portion in the ring buffer DOES wrap let len = self.copy_from(buf, self.end..start); @@ -253,24 +245,8 @@ impl<'a, W: Word> WritableDmaRingBuffer<'a, W> { Ok((len, self.cap() - (start - self.end))) } } else if start == self.end && dma.get_complete_count() == 0 { - trace!( - "[2]: start, end, len, complete_count: {}, {}, {}, {}", - start, - self.end, - buf.len(), - dma.get_complete_count() - ); - Ok((0, 0)) } else if start <= self.end && self.end + buf.len() < self.cap() { - trace!( - "[3]: start, end, len, complete_count: {}, {}, {}, {}", - start, - self.end, - buf.len(), - dma.get_complete_count() - ); - // The occupied portion in the ring buffer DOES NOT wrap // and copying elements into the buffer WILL NOT cause it to @@ -289,14 +265,6 @@ impl<'a, W: Word> WritableDmaRingBuffer<'a, W> { Ok((len, self.cap() - (self.end - start))) } } else { - trace!( - "[4]: start, end, len, complete_count: {}, {}, {}, {}", - start, - self.end, - buf.len(), - dma.get_complete_count() - ); - // The occupied portion in the ring buffer DOES NOT wrap // and copying elements into the buffer WILL cause it to