diff options
| author | elagil <[email protected]> | 2024-11-17 23:56:45 +0100 |
|---|---|---|
| committer | elagil <[email protected]> | 2024-11-17 23:56:45 +0100 |
| commit | ee9ca4470370ae9e0e98a54ceb94ec83da20eb19 (patch) | |
| tree | efe76feb65ba73dcdc6ebccb4c06e3009036bec0 /embassy-stm32 | |
| parent | 7ae28163414d0042c4e06cc02de900e67b62df01 (diff) | |
refactor: naming of wait functions
Diffstat (limited to 'embassy-stm32')
| -rw-r--r-- | embassy-stm32/src/dma/dma_bdma.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/dma/ringbuffer/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/sai/mod.rs | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/embassy-stm32/src/dma/dma_bdma.rs b/embassy-stm32/src/dma/dma_bdma.rs index 90160ed50..1945c3587 100644 --- a/embassy-stm32/src/dma/dma_bdma.rs +++ b/embassy-stm32/src/dma/dma_bdma.rs | |||
| @@ -1007,9 +1007,9 @@ impl<'a, W: Word> WritableRingBuffer<'a, W> { | |||
| 1007 | } | 1007 | } |
| 1008 | 1008 | ||
| 1009 | /// Wait for any ring buffer write error. | 1009 | /// Wait for any ring buffer write error. |
| 1010 | pub async fn write_error(&mut self) -> Result<usize, Error> { | 1010 | pub async fn wait_write_error(&mut self) -> Result<usize, Error> { |
| 1011 | self.ringbuf | 1011 | self.ringbuf |
| 1012 | .write_error(&mut DmaCtrlImpl(self.channel.reborrow())) | 1012 | .wait_write_error(&mut DmaCtrlImpl(self.channel.reborrow())) |
| 1013 | .await | 1013 | .await |
| 1014 | } | 1014 | } |
| 1015 | 1015 | ||
diff --git a/embassy-stm32/src/dma/ringbuffer/mod.rs b/embassy-stm32/src/dma/ringbuffer/mod.rs index b7f98fbce..25bdc7522 100644 --- a/embassy-stm32/src/dma/ringbuffer/mod.rs +++ b/embassy-stm32/src/dma/ringbuffer/mod.rs | |||
| @@ -261,7 +261,7 @@ impl<'a, W: Word> WritableDmaRingBuffer<'a, W> { | |||
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | /// Wait for any ring buffer write error. | 263 | /// Wait for any ring buffer write error. |
| 264 | pub async fn write_error(&mut self, dma: &mut impl DmaCtrl) -> Result<usize, Error> { | 264 | pub async fn wait_write_error(&mut self, dma: &mut impl DmaCtrl) -> Result<usize, Error> { |
| 265 | poll_fn(|cx| { | 265 | poll_fn(|cx| { |
| 266 | dma.set_waker(cx.waker()); | 266 | dma.set_waker(cx.waker()); |
| 267 | 267 | ||
diff --git a/embassy-stm32/src/sai/mod.rs b/embassy-stm32/src/sai/mod.rs index fd61e5339..a8d02f825 100644 --- a/embassy-stm32/src/sai/mod.rs +++ b/embassy-stm32/src/sai/mod.rs | |||
| @@ -1009,10 +1009,10 @@ impl<'d, T: Instance, W: word::Word> Sai<'d, T, W> { | |||
| 1009 | /// experiences an overrun of the ring buffer. Then, instead of letting | 1009 | /// experiences an overrun of the ring buffer. Then, instead of letting |
| 1010 | /// the SAI peripheral play the last written buffer over and over again, SAI | 1010 | /// the SAI peripheral play the last written buffer over and over again, SAI |
| 1011 | /// can be muted or dropped instead. | 1011 | /// can be muted or dropped instead. |
| 1012 | pub async fn write_error(&mut self) -> Result<(), Error> { | 1012 | pub async fn wait_write_error(&mut self) -> Result<(), Error> { |
| 1013 | match &mut self.ring_buffer { | 1013 | match &mut self.ring_buffer { |
| 1014 | RingBuffer::Writable(buffer) => { | 1014 | RingBuffer::Writable(buffer) => { |
| 1015 | buffer.write_error().await?; | 1015 | buffer.wait_write_error().await?; |
| 1016 | Ok(()) | 1016 | Ok(()) |
| 1017 | } | 1017 | } |
| 1018 | _ => return Err(Error::NotATransmitter), | 1018 | _ => return Err(Error::NotATransmitter), |
