From 9531b7422b0bf231d5782bb60b65eeb823b199ff Mon Sep 17 00:00:00 2001 From: i509VCB Date: Thu, 13 Mar 2025 22:26:06 -0500 Subject: rustfmt... --- embassy-mspm0/src/gpio.rs | 22 ++++++---------------- embassy-mspm0/src/lib.rs | 9 ++------- embassy-mspm0/src/time_driver.rs | 30 ++++++++---------------------- 3 files changed, 16 insertions(+), 45 deletions(-) (limited to 'embassy-mspm0/src') diff --git a/embassy-mspm0/src/gpio.rs b/embassy-mspm0/src/gpio.rs index fd4dc55ab..e1eb7eecf 100644 --- a/embassy-mspm0/src/gpio.rs +++ b/embassy-mspm0/src/gpio.rs @@ -7,13 +7,12 @@ use core::task::{Context, Poll}; use embassy_hal_internal::{impl_peripheral, into_ref, Peripheral, PeripheralRef}; use embassy_sync::waitqueue::AtomicWaker; + +use crate::pac::gpio::vals::*; +use crate::pac::gpio::{self}; #[cfg(all(feature = "rt", feature = "mspm0c110x"))] use crate::pac::interrupt; - -use crate::pac::{ - self, - gpio::{self, vals::*}, -}; +use crate::pac::{self}; /// Represents a digital input or output level. #[derive(Debug, Eq, PartialEq, Clone, Copy)] @@ -88,9 +87,7 @@ impl<'d> Flex<'d> { into_ref!(pin); // Pin will be in disconnected state. - Self { - pin: pin.map_into(), - } + Self { pin: pin.map_into() } } /// Set the pin's pull. @@ -974,14 +971,7 @@ impl<'d> Future for InputFuture<'d> { waker.register(cx.waker()); // The interrupt handler will mask the interrupt if the event has occurred. - if self - .pin - .block() - .cpu_int() - .ris() - .read() - .dio(self.pin.bit_index()) - { + if self.pin.block().cpu_int().ris().read().dio(self.pin.bit_index()) { return Poll::Ready(()); } diff --git a/embassy-mspm0/src/lib.rs b/embassy-mspm0/src/lib.rs index ee629f063..1191b1010 100644 --- a/embassy-mspm0/src/lib.rs +++ b/embassy-mspm0/src/lib.rs @@ -1,10 +1,6 @@ #![no_std] // Doc feature labels can be tested locally by running RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc -#![cfg_attr( - docsrs, - feature(doc_auto_cfg, doc_cfg_hide), - doc(cfg_hide(doc, docsrs)) -)] +#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide), doc(cfg_hide(doc, docsrs)))] // This mod MUST go first, so that the others see its macros. pub(crate) mod fmt; @@ -40,6 +36,7 @@ pub(crate) mod _generated { } // Reexports +pub(crate) use _generated::gpio_pincm; pub use _generated::{peripherals, Peripherals}; pub use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef}; #[cfg(feature = "unstable-pac")] @@ -48,8 +45,6 @@ pub use mspm0_metapac as pac; pub(crate) use mspm0_metapac as pac; pub use crate::_generated::interrupt; -pub(crate) use _generated::gpio_pincm; - /// `embassy-mspm0` global configuration. #[non_exhaustive] diff --git a/embassy-mspm0/src/time_driver.rs b/embassy-mspm0/src/time_driver.rs index 3af7a5edb..937ce58d4 100644 --- a/embassy-mspm0/src/time_driver.rs +++ b/embassy-mspm0/src/time_driver.rs @@ -1,19 +1,13 @@ -use core::{ - cell::{Cell, RefCell}, - sync::atomic::{compiler_fence, AtomicU32, Ordering}, - task::Waker, -}; +use core::cell::{Cell, RefCell}; +use core::sync::atomic::{compiler_fence, AtomicU32, Ordering}; +use core::task::Waker; use critical_section::{CriticalSection, Mutex}; use embassy_time_driver::Driver; use embassy_time_queue_utils::Queue; -use mspm0_metapac::{ - interrupt, - tim::{ - vals::{Cm, Cvae, CxC, EvtCfg, PwrenKey, Ratio, Repeat, ResetKey}, - Counterregs16, Tim, - }, -}; +use mspm0_metapac::interrupt; +use mspm0_metapac::tim::vals::{Cm, Cvae, CxC, EvtCfg, PwrenKey, Ratio, Repeat, ResetKey}; +use mspm0_metapac::tim::{Counterregs16, Tim}; use crate::peripherals; use crate::timer::SealedTimer; @@ -244,18 +238,10 @@ impl TimxDriver { } fn trigger_alarm(&self, cs: CriticalSection) { - let mut next = self - .queue - .borrow(cs) - .borrow_mut() - .next_expiration(self.now()); + let mut next = self.queue.borrow(cs).borrow_mut().next_expiration(self.now()); while !self.set_alarm(cs, next) { - next = self - .queue - .borrow(cs) - .borrow_mut() - .next_expiration(self.now()); + next = self.queue.borrow(cs).borrow_mut().next_expiration(self.now()); } } -- cgit