diff options
| author | xoviat <[email protected]> | 2025-12-08 08:19:24 -0600 |
|---|---|---|
| committer | xoviat <[email protected]> | 2025-12-08 08:19:24 -0600 |
| commit | c93da8fc6d76cd6978c0cfbfb3ab42b0285af8d8 (patch) | |
| tree | e745116af2890bdd54821eeb44aed44a3cffff3b /embassy-stm32/src/usart | |
| parent | 2a738c147111569e4f0968020eec6fb5d5d4e754 (diff) | |
low-power: use scoped block stop
Co-authored-by: hjeldin <[email protected]>
Diffstat (limited to 'embassy-stm32/src/usart')
| -rw-r--r-- | embassy-stm32/src/usart/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index 8047d6005..d2c361c61 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs | |||
| @@ -491,7 +491,7 @@ impl<'d> UartTx<'d, Async> { | |||
| 491 | 491 | ||
| 492 | /// Initiate an asynchronous UART write | 492 | /// Initiate an asynchronous UART write |
| 493 | pub async fn write(&mut self, buffer: &[u8]) -> Result<(), Error> { | 493 | pub async fn write(&mut self, buffer: &[u8]) -> Result<(), Error> { |
| 494 | let _ = self.info.rcc.block_stop(); | 494 | let _scoped_block_stop = self.info.rcc.block_stop(); |
| 495 | 495 | ||
| 496 | let r = self.info.regs; | 496 | let r = self.info.regs; |
| 497 | 497 | ||
| @@ -510,7 +510,7 @@ impl<'d> UartTx<'d, Async> { | |||
| 510 | 510 | ||
| 511 | /// Wait until transmission complete | 511 | /// Wait until transmission complete |
| 512 | pub async fn flush(&mut self) -> Result<(), Error> { | 512 | pub async fn flush(&mut self) -> Result<(), Error> { |
| 513 | let _ = self.info.rcc.block_stop(); | 513 | let _scoped_block_stop = self.info.rcc.block_stop(); |
| 514 | 514 | ||
| 515 | flush(&self.info, &self.state).await | 515 | flush(&self.info, &self.state).await |
| 516 | } | 516 | } |
| @@ -730,7 +730,7 @@ impl<'d> UartRx<'d, Async> { | |||
| 730 | 730 | ||
| 731 | /// Initiate an asynchronous UART read | 731 | /// Initiate an asynchronous UART read |
| 732 | pub async fn read(&mut self, buffer: &mut [u8]) -> Result<(), Error> { | 732 | pub async fn read(&mut self, buffer: &mut [u8]) -> Result<(), Error> { |
| 733 | let _ = self.info.rcc.block_stop(); | 733 | let _scoped_block_stop = self.info.rcc.block_stop(); |
| 734 | 734 | ||
| 735 | self.inner_read(buffer, false).await?; | 735 | self.inner_read(buffer, false).await?; |
| 736 | 736 | ||
| @@ -739,7 +739,7 @@ impl<'d> UartRx<'d, Async> { | |||
| 739 | 739 | ||
| 740 | /// Initiate an asynchronous read with idle line detection enabled | 740 | /// Initiate an asynchronous read with idle line detection enabled |
| 741 | pub async fn read_until_idle(&mut self, buffer: &mut [u8]) -> Result<usize, Error> { | 741 | pub async fn read_until_idle(&mut self, buffer: &mut [u8]) -> Result<usize, Error> { |
| 742 | let _ = self.info.rcc.block_stop(); | 742 | let _scoped_block_stop = self.info.rcc.block_stop(); |
| 743 | 743 | ||
| 744 | self.inner_read(buffer, true).await | 744 | self.inner_read(buffer, true).await |
| 745 | } | 745 | } |
