diff options
| author | xoviat <[email protected]> | 2023-07-30 09:28:02 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-07-30 09:28:02 -0500 |
| commit | 087e649bc297676c483f1f2a94a5abf101dea9a2 (patch) | |
| tree | 202cf25e2d3387c0efd6674ef8f58b378763859a | |
| parent | fd9b6487e12dff80bf9e23cba474af5d8773c8a7 (diff) | |
stm32/dma: fix typos
| -rw-r--r-- | embassy-stm32/src/dma/bdma.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-stm32/src/dma/bdma.rs b/embassy-stm32/src/dma/bdma.rs index 2905338de..60f4fbd09 100644 --- a/embassy-stm32/src/dma/bdma.rs +++ b/embassy-stm32/src/dma/bdma.rs | |||
| @@ -631,9 +631,9 @@ impl<'a, C: Channel, W: Word> WritableRingBuffer<'a, C, W> { | |||
| 631 | self.ringbuf.clear(DmaCtrlImpl(self.channel.reborrow())); | 631 | self.ringbuf.clear(DmaCtrlImpl(self.channel.reborrow())); |
| 632 | } | 632 | } |
| 633 | 633 | ||
| 634 | /// Write elements from the ring buffer | 634 | /// Write elements to the ring buffer |
| 635 | /// Return a tuple of the length written and the length remaining in the buffer | 635 | /// Return a tuple of the length written and the length remaining in the buffer |
| 636 | pub fn read(&mut self, buf: &[W]) -> Result<(usize, usize), OverrunError> { | 636 | pub fn write(&mut self, buf: &[W]) -> Result<(usize, usize), OverrunError> { |
| 637 | self.ringbuf.write(DmaCtrlImpl(self.channel.reborrow()), buf) | 637 | self.ringbuf.write(DmaCtrlImpl(self.channel.reborrow()), buf) |
| 638 | } | 638 | } |
| 639 | 639 | ||
| @@ -650,7 +650,7 @@ impl<'a, C: Channel, W: Word> WritableRingBuffer<'a, C, W> { | |||
| 650 | 650 | ||
| 651 | compiler_fence(Ordering::SeqCst); | 651 | compiler_fence(Ordering::SeqCst); |
| 652 | 652 | ||
| 653 | match self.read(&buffer[written_data..buffer_len]) { | 653 | match self.write(&buffer[written_data..buffer_len]) { |
| 654 | Ok((len, remaining)) => { | 654 | Ok((len, remaining)) => { |
| 655 | written_data += len; | 655 | written_data += len; |
| 656 | if written_data == buffer_len { | 656 | if written_data == buffer_len { |
