stm32/dma: fix condition check
This commit is contained in:
parent
6f30e92c7a
commit
538cf2bc24
@ -236,7 +236,7 @@ impl<'a, W: Word> WritableDmaRingBuffer<'a, W> {
|
||||
|
||||
// Confirm that the DMA is not inside data we could have written
|
||||
let pos = self.pos(dma.get_remaining_transfers());
|
||||
if (pos > self.end && pos <= start) || dma.get_complete_count() > 1 {
|
||||
if (pos > self.end && pos <= start) || dma.get_complete_count() > 0 {
|
||||
Err(OverrunError)
|
||||
} else {
|
||||
self.end = (self.end + len) % self.cap();
|
||||
|
Loading…
Reference in New Issue
Block a user