refactor: naming of wait functions

This commit is contained in:
elagil 2024-11-17 23:56:45 +01:00
parent 7ae2816341
commit ee9ca44703
3 changed files with 5 additions and 5 deletions

View File

@ -1007,9 +1007,9 @@ impl<'a, W: Word> WritableRingBuffer<'a, W> {
} }
/// Wait for any ring buffer write error. /// Wait for any ring buffer write error.
pub async fn write_error(&mut self) -> Result<usize, Error> { pub async fn wait_write_error(&mut self) -> Result<usize, Error> {
self.ringbuf self.ringbuf
.write_error(&mut DmaCtrlImpl(self.channel.reborrow())) .wait_write_error(&mut DmaCtrlImpl(self.channel.reborrow()))
.await .await
} }

View File

@ -261,7 +261,7 @@ impl<'a, W: Word> WritableDmaRingBuffer<'a, W> {
} }
/// Wait for any ring buffer write error. /// Wait for any ring buffer write error.
pub async fn write_error(&mut self, dma: &mut impl DmaCtrl) -> Result<usize, Error> { pub async fn wait_write_error(&mut self, dma: &mut impl DmaCtrl) -> Result<usize, Error> {
poll_fn(|cx| { poll_fn(|cx| {
dma.set_waker(cx.waker()); dma.set_waker(cx.waker());

View File

@ -1009,10 +1009,10 @@ impl<'d, T: Instance, W: word::Word> Sai<'d, T, W> {
/// experiences an overrun of the ring buffer. Then, instead of letting /// experiences an overrun of the ring buffer. Then, instead of letting
/// the SAI peripheral play the last written buffer over and over again, SAI /// the SAI peripheral play the last written buffer over and over again, SAI
/// can be muted or dropped instead. /// can be muted or dropped instead.
pub async fn write_error(&mut self) -> Result<(), Error> { pub async fn wait_write_error(&mut self) -> Result<(), Error> {
match &mut self.ring_buffer { match &mut self.ring_buffer {
RingBuffer::Writable(buffer) => { RingBuffer::Writable(buffer) => {
buffer.write_error().await?; buffer.wait_write_error().await?;
Ok(()) Ok(())
} }
_ => return Err(Error::NotATransmitter), _ => return Err(Error::NotATransmitter),