diff options
| author | Eric Yanush <[email protected]> | 2024-04-22 14:05:28 -0600 |
|---|---|---|
| committer | Eric Yanush <[email protected]> | 2024-04-22 14:05:28 -0600 |
| commit | 5c56aff9c263308ccc866082bfbcfff2dadf80c4 (patch) | |
| tree | e76fc3a61e32ab3774c91f4ae82a05eeb533776d | |
| parent | e65503e25537ba872f02137713bdc4e5bf645a13 (diff) | |
rustfmt fixes
| -rw-r--r-- | embassy-stm32/src/can/bxcan/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/embassy-stm32/src/can/bxcan/mod.rs b/embassy-stm32/src/can/bxcan/mod.rs index 342040c25..912634b84 100644 --- a/embassy-stm32/src/can/bxcan/mod.rs +++ b/embassy-stm32/src/can/bxcan/mod.rs | |||
| @@ -261,7 +261,7 @@ impl<'d, T: Instance> Can<'d, T> { | |||
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | /// Manually wake the peripheral from sleep mode. | 263 | /// Manually wake the peripheral from sleep mode. |
| 264 | /// | 264 | /// |
| 265 | /// Waking the peripheral manually does not trigger a wake-up interrupt. | 265 | /// Waking the peripheral manually does not trigger a wake-up interrupt. |
| 266 | /// This will wait until the peripheral has acknowledged it has awoken from sleep mode | 266 | /// This will wait until the peripheral has acknowledged it has awoken from sleep mode |
| 267 | pub fn wakeup(&mut self) { | 267 | pub fn wakeup(&mut self) { |
| @@ -274,17 +274,17 @@ impl<'d, T: Instance> Can<'d, T> { | |||
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | /// Put the peripheral in sleep mode | 276 | /// Put the peripheral in sleep mode |
| 277 | /// | 277 | /// |
| 278 | /// When the peripherial is in sleep mode, messages can still be queued for transmission | 278 | /// When the peripherial is in sleep mode, messages can still be queued for transmission |
| 279 | /// and any previously received messages can be read from the receive FIFOs, however | 279 | /// and any previously received messages can be read from the receive FIFOs, however |
| 280 | /// no messages will be transmitted and no additional messages will be received. | 280 | /// no messages will be transmitted and no additional messages will be received. |
| 281 | /// | 281 | /// |
| 282 | /// If the peripheral has automatic wakeup enabled, when a Start-of-Frame is detected | 282 | /// If the peripheral has automatic wakeup enabled, when a Start-of-Frame is detected |
| 283 | /// the peripheral will automatically wake and receive the incoming message. | 283 | /// the peripheral will automatically wake and receive the incoming message. |
| 284 | pub async fn sleep(&mut self) { | 284 | pub async fn sleep(&mut self) { |
| 285 | T::regs().ier().modify(|i| i.set_slkie(true)); | 285 | T::regs().ier().modify(|i| i.set_slkie(true)); |
| 286 | T::regs().mcr().modify(|m| m.set_sleep(true)); | 286 | T::regs().mcr().modify(|m| m.set_sleep(true)); |
| 287 | 287 | ||
| 288 | poll_fn(|cx| { | 288 | poll_fn(|cx| { |
| 289 | T::state().err_waker.register(cx.waker()); | 289 | T::state().err_waker.register(cx.waker()); |
| 290 | if self.is_sleeping() { | 290 | if self.is_sleeping() { |
| @@ -292,7 +292,8 @@ impl<'d, T: Instance> Can<'d, T> { | |||
| 292 | } else { | 292 | } else { |
| 293 | Poll::Pending | 293 | Poll::Pending |
| 294 | } | 294 | } |
| 295 | }).await; | 295 | }) |
| 296 | .await; | ||
| 296 | 297 | ||
| 297 | T::regs().ier().modify(|i| i.set_slkie(false)); | 298 | T::regs().ier().modify(|i| i.set_slkie(false)); |
| 298 | } | 299 | } |
