stm32/dma: fix typos
This commit is contained in:
parent
fd9b6487e1
commit
087e649bc2
@ -631,9 +631,9 @@ impl<'a, C: Channel, W: Word> WritableRingBuffer<'a, C, W> {
|
|||||||
self.ringbuf.clear(DmaCtrlImpl(self.channel.reborrow()));
|
self.ringbuf.clear(DmaCtrlImpl(self.channel.reborrow()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Write elements from the ring buffer
|
/// Write elements to the ring buffer
|
||||||
/// Return a tuple of the length written and the length remaining in the buffer
|
/// Return a tuple of the length written and the length remaining in the buffer
|
||||||
pub fn read(&mut self, buf: &[W]) -> Result<(usize, usize), OverrunError> {
|
pub fn write(&mut self, buf: &[W]) -> Result<(usize, usize), OverrunError> {
|
||||||
self.ringbuf.write(DmaCtrlImpl(self.channel.reborrow()), buf)
|
self.ringbuf.write(DmaCtrlImpl(self.channel.reborrow()), buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -650,7 +650,7 @@ impl<'a, C: Channel, W: Word> WritableRingBuffer<'a, C, W> {
|
|||||||
|
|
||||||
compiler_fence(Ordering::SeqCst);
|
compiler_fence(Ordering::SeqCst);
|
||||||
|
|
||||||
match self.read(&buffer[written_data..buffer_len]) {
|
match self.write(&buffer[written_data..buffer_len]) {
|
||||||
Ok((len, remaining)) => {
|
Ok((len, remaining)) => {
|
||||||
written_data += len;
|
written_data += len;
|
||||||
if written_data == buffer_len {
|
if written_data == buffer_len {
|
||||||
|
Loading…
Reference in New Issue
Block a user