Issue #2059 use write_immediate. Add docs. Remove half-write workaround
This commit is contained in:
@ -876,6 +876,18 @@ impl<'a, C: Channel, W: Word> WritableRingBuffer<'a, C, W> {
|
||||
self.ringbuf.clear(&mut DmaCtrlImpl(self.channel.reborrow()));
|
||||
}
|
||||
|
||||
/// Write elements directly to the raw buffer.
|
||||
/// This can be used to fill the buffer before starting the DMA transfer.
|
||||
pub fn write_immediate(&mut self, buf: &[W]) -> Result<(usize, usize), OverrunError> {
|
||||
self.ringbuf.write_immediate(
|
||||
&mut DmaCtrlImpl {
|
||||
channel: self.channel.reborrow(),
|
||||
word_size: W::size(),
|
||||
},
|
||||
buf,
|
||||
)
|
||||
}
|
||||
|
||||
/// Write elements from the ring buffer
|
||||
/// Return a tuple of the length written and the length remaining in the buffer
|
||||
pub fn write(&mut self, buf: &[W]) -> Result<(usize, usize), OverrunError> {
|
||||
|
Reference in New Issue
Block a user