mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 14:22:33 +00:00
refactor: naming of wait functions
This commit is contained in:
parent
7ae2816341
commit
ee9ca44703
@ -1007,9 +1007,9 @@ impl<'a, W: Word> WritableRingBuffer<'a, W> {
|
||||
}
|
||||
|
||||
/// 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
|
||||
.write_error(&mut DmaCtrlImpl(self.channel.reborrow()))
|
||||
.wait_write_error(&mut DmaCtrlImpl(self.channel.reborrow()))
|
||||
.await
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,7 @@ impl<'a, W: Word> WritableDmaRingBuffer<'a, W> {
|
||||
}
|
||||
|
||||
/// 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| {
|
||||
dma.set_waker(cx.waker());
|
||||
|
||||
|
@ -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
|
||||
/// the SAI peripheral play the last written buffer over and over again, SAI
|
||||
/// 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 {
|
||||
RingBuffer::Writable(buffer) => {
|
||||
buffer.write_error().await?;
|
||||
buffer.wait_write_error().await?;
|
||||
Ok(())
|
||||
}
|
||||
_ => return Err(Error::NotATransmitter),
|
||||
|
Loading…
Reference in New Issue
Block a user