rustfmt fixes

This commit is contained in:
Eric Yanush 2024-04-22 14:05:28 -06:00
parent e65503e255
commit 5c56aff9c2

View file

@ -261,7 +261,7 @@ impl<'d, T: Instance> Can<'d, T> {
} }
/// Manually wake the peripheral from sleep mode. /// Manually wake the peripheral from sleep mode.
/// ///
/// Waking the peripheral manually does not trigger a wake-up interrupt. /// Waking the peripheral manually does not trigger a wake-up interrupt.
/// This will wait until the peripheral has acknowledged it has awoken from sleep mode /// This will wait until the peripheral has acknowledged it has awoken from sleep mode
pub fn wakeup(&mut self) { pub fn wakeup(&mut self) {
@ -274,17 +274,17 @@ impl<'d, T: Instance> Can<'d, T> {
} }
/// Put the peripheral in sleep mode /// Put the peripheral in sleep mode
/// ///
/// When the peripherial is in sleep mode, messages can still be queued for transmission /// When the peripherial is in sleep mode, messages can still be queued for transmission
/// and any previously received messages can be read from the receive FIFOs, however /// and any previously received messages can be read from the receive FIFOs, however
/// no messages will be transmitted and no additional messages will be received. /// no messages will be transmitted and no additional messages will be received.
/// ///
/// If the peripheral has automatic wakeup enabled, when a Start-of-Frame is detected /// If the peripheral has automatic wakeup enabled, when a Start-of-Frame is detected
/// the peripheral will automatically wake and receive the incoming message. /// the peripheral will automatically wake and receive the incoming message.
pub async fn sleep(&mut self) { pub async fn sleep(&mut self) {
T::regs().ier().modify(|i| i.set_slkie(true)); T::regs().ier().modify(|i| i.set_slkie(true));
T::regs().mcr().modify(|m| m.set_sleep(true)); T::regs().mcr().modify(|m| m.set_sleep(true));
poll_fn(|cx| { poll_fn(|cx| {
T::state().err_waker.register(cx.waker()); T::state().err_waker.register(cx.waker());
if self.is_sleeping() { if self.is_sleeping() {
@ -292,7 +292,8 @@ impl<'d, T: Instance> Can<'d, T> {
} else { } else {
Poll::Pending Poll::Pending
} }
}).await; })
.await;
T::regs().ier().modify(|i| i.set_slkie(false)); T::regs().ier().modify(|i| i.set_slkie(false));
} }