From e7e4d0e03f6ccee7a8577058bfccefaf92b2689e Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 4 Dec 2025 19:19:23 +0100 Subject: rustfmt --- embassy-mcxa/src/adc.rs | 2 +- embassy-mcxa/src/clkout.rs | 2 +- embassy-mcxa/src/clocks/periph_helpers.rs | 6 +----- embassy-mcxa/src/i2c/controller.rs | 6 +++--- embassy-mcxa/src/interrupt.rs | 2 +- embassy-mcxa/src/lpuart/buffered.rs | 2 +- embassy-mcxa/src/lpuart/mod.rs | 6 +++--- embassy-mcxa/src/ostimer.rs | 8 ++++---- examples/mcxa/src/bin/adc_interrupt.rs | 4 ++-- examples/mcxa/src/bin/adc_polling.rs | 2 +- examples/mcxa/src/bin/i2c-async.rs | 2 +- examples/mcxa/src/bin/i2c-scan-blocking.rs | 2 +- examples/mcxa/src/bin/lpuart_buffered.rs | 2 +- 13 files changed, 21 insertions(+), 25 deletions(-) diff --git a/embassy-mcxa/src/adc.rs b/embassy-mcxa/src/adc.rs index b5ec5983f..7475299ba 100644 --- a/embassy-mcxa/src/adc.rs +++ b/embassy-mcxa/src/adc.rs @@ -4,7 +4,7 @@ use core::sync::atomic::{AtomicBool, Ordering}; use embassy_hal_internal::{Peri, PeripheralType}; use crate::clocks::periph_helpers::{AdcClockSel, AdcConfig, Div4}; -use crate::clocks::{enable_and_reset, Gate, PoweredClock}; +use crate::clocks::{Gate, PoweredClock, enable_and_reset}; use crate::pac; use crate::pac::adc1::cfg::{HptExdi, Pwrsel, Refsel, Tcmdres, Tprictrl, Tres}; use crate::pac::adc1::cmdh1::{Avgs, Cmpen, Next, Sts}; diff --git a/embassy-mcxa/src/clkout.rs b/embassy-mcxa/src/clkout.rs index 88c731df1..5b21f24b0 100644 --- a/embassy-mcxa/src/clkout.rs +++ b/embassy-mcxa/src/clkout.rs @@ -9,7 +9,7 @@ use core::marker::PhantomData; use embassy_hal_internal::Peri; pub use crate::clocks::periph_helpers::Div4; -use crate::clocks::{with_clocks, ClockError, PoweredClock}; +use crate::clocks::{ClockError, PoweredClock, with_clocks}; use crate::pac::mrcc0::mrcc_clkout_clksel::Mux; use crate::peripherals::CLKOUT; diff --git a/embassy-mcxa/src/clocks/periph_helpers.rs b/embassy-mcxa/src/clocks/periph_helpers.rs index 1ea7a99ed..fed5e558e 100644 --- a/embassy-mcxa/src/clocks/periph_helpers.rs +++ b/embassy-mcxa/src/clocks/periph_helpers.rs @@ -108,11 +108,7 @@ impl Div4 { /// by 1, and `Div4::from_raw(15)` will divide the source by /// 16. pub const fn from_raw(n: u8) -> Option { - if n > 0b1111 { - None - } else { - Some(Self(n)) - } + if n > 0b1111 { None } else { Some(Self(n)) } } /// Store a specific divisor value that will divide the source diff --git a/embassy-mcxa/src/i2c/controller.rs b/embassy-mcxa/src/i2c/controller.rs index 182a53aea..c27d508b0 100644 --- a/embassy-mcxa/src/i2c/controller.rs +++ b/embassy-mcxa/src/i2c/controller.rs @@ -3,15 +3,15 @@ use core::future::Future; use core::marker::PhantomData; -use embassy_hal_internal::drop::OnDrop; use embassy_hal_internal::Peri; +use embassy_hal_internal::drop::OnDrop; use mcxa_pac::lpi2c0::mtdr::Cmd; use super::{Async, Blocking, Error, Instance, InterruptHandler, Mode, Result, SclPin, SdaPin}; +use crate::AnyPin; use crate::clocks::periph_helpers::{Div4, Lpi2cClockSel, Lpi2cConfig}; -use crate::clocks::{enable_and_reset, PoweredClock}; +use crate::clocks::{PoweredClock, enable_and_reset}; use crate::interrupt::typelevel::Interrupt; -use crate::AnyPin; /// Bus speed (nominal SCL, no clock stretching) #[derive(Clone, Copy, Default, PartialEq)] diff --git a/embassy-mcxa/src/interrupt.rs b/embassy-mcxa/src/interrupt.rs index 1d10e3b2d..c1f7e55a0 100644 --- a/embassy-mcxa/src/interrupt.rs +++ b/embassy-mcxa/src/interrupt.rs @@ -32,7 +32,7 @@ mod generated { use core::sync::atomic::{AtomicU16, AtomicU32, Ordering}; -pub use generated::interrupt::{typelevel, Priority}; +pub use generated::interrupt::{Priority, typelevel}; use crate::pac::Interrupt; diff --git a/embassy-mcxa/src/lpuart/buffered.rs b/embassy-mcxa/src/lpuart/buffered.rs index 8eb443ca7..34fdbb76c 100644 --- a/embassy-mcxa/src/lpuart/buffered.rs +++ b/embassy-mcxa/src/lpuart/buffered.rs @@ -3,8 +3,8 @@ use core::marker::PhantomData; use core::sync::atomic::{AtomicBool, Ordering}; use core::task::Poll; -use embassy_hal_internal::atomic_ring_buffer::RingBuffer; use embassy_hal_internal::Peri; +use embassy_hal_internal::atomic_ring_buffer::RingBuffer; use embassy_sync::waitqueue::AtomicWaker; use super::*; diff --git a/embassy-mcxa/src/lpuart/mod.rs b/embassy-mcxa/src/lpuart/mod.rs index 2d8308ec8..b8a2d5172 100644 --- a/embassy-mcxa/src/lpuart/mod.rs +++ b/embassy-mcxa/src/lpuart/mod.rs @@ -4,13 +4,13 @@ use embassy_hal_internal::{Peri, PeripheralType}; use paste::paste; use crate::clocks::periph_helpers::{Div4, LpuartClockSel, LpuartConfig}; -use crate::clocks::{enable_and_reset, ClockError, Gate, PoweredClock}; +use crate::clocks::{ClockError, Gate, PoweredClock, enable_and_reset}; use crate::gpio::SealedPin; use crate::pac::lpuart0::baud::Sbns as StopBits; -use crate::pac::lpuart0::ctrl::{Idlecfg as IdleConfig, Ilt as IdleType, Pt as Parity, M as DataBits}; +use crate::pac::lpuart0::ctrl::{Idlecfg as IdleConfig, Ilt as IdleType, M as DataBits, Pt as Parity}; use crate::pac::lpuart0::modir::{Txctsc as TxCtsConfig, Txctssrc as TxCtsSource}; use crate::pac::lpuart0::stat::Msbf as MsbFirst; -use crate::{interrupt, pac, AnyPin}; +use crate::{AnyPin, interrupt, pac}; pub mod buffered; diff --git a/embassy-mcxa/src/ostimer.rs b/embassy-mcxa/src/ostimer.rs index c51812e3d..9e66e82d8 100644 --- a/embassy-mcxa/src/ostimer.rs +++ b/embassy-mcxa/src/ostimer.rs @@ -32,7 +32,7 @@ use core::sync::atomic::{AtomicBool, Ordering}; use embassy_hal_internal::{Peri, PeripheralType}; use crate::clocks::periph_helpers::{OsTimerConfig, OstimerClockSel}; -use crate::clocks::{assert_reset, enable_and_reset, is_reset_released, release_reset, Gate, PoweredClock}; +use crate::clocks::{Gate, PoweredClock, assert_reset, enable_and_reset, is_reset_released, release_reset}; use crate::interrupt::InterruptExt; use crate::pac; @@ -521,11 +521,11 @@ pub mod time_driver { use embassy_time_driver as etd; use super::{ - bin_to_gray, now_ticks_read, Regs, ALARM_ACTIVE, ALARM_CALLBACK, ALARM_FLAG, ALARM_TARGET_TIME, - EVTIMER_HI_MASK, EVTIMER_HI_SHIFT, LOW_32_BIT_MASK, + ALARM_ACTIVE, ALARM_CALLBACK, ALARM_FLAG, ALARM_TARGET_TIME, EVTIMER_HI_MASK, EVTIMER_HI_SHIFT, + LOW_32_BIT_MASK, Regs, bin_to_gray, now_ticks_read, }; use crate::clocks::periph_helpers::{OsTimerConfig, OstimerClockSel}; - use crate::clocks::{enable_and_reset, PoweredClock}; + use crate::clocks::{PoweredClock, enable_and_reset}; use crate::pac; #[allow(non_camel_case_types)] diff --git a/examples/mcxa/src/bin/adc_interrupt.rs b/examples/mcxa/src/bin/adc_interrupt.rs index 83d8046b3..c88b1fe8d 100644 --- a/examples/mcxa/src/bin/adc_interrupt.rs +++ b/examples/mcxa/src/bin/adc_interrupt.rs @@ -4,13 +4,13 @@ use embassy_executor::Spawner; use embassy_mcxa_examples::init_adc_pins; use hal::adc::{LpadcConfig, TriggerPriorityPolicy}; -use hal::clocks::periph_helpers::{AdcClockSel, Div4}; use hal::clocks::PoweredClock; +use hal::clocks::periph_helpers::{AdcClockSel, Div4}; use hal::pac::adc1::cfg::{Pwrsel, Refsel}; use hal::pac::adc1::cmdl1::{Adch, Mode}; use hal::pac::adc1::ctrl::CalAvgs; use hal::pac::adc1::tctrl::Tcmd; -use hal::{bind_interrupts, InterruptExt}; +use hal::{InterruptExt, bind_interrupts}; use {defmt_rtt as _, embassy_mcxa as hal, panic_probe as _}; bind_interrupts!(struct Irqs { diff --git a/examples/mcxa/src/bin/adc_polling.rs b/examples/mcxa/src/bin/adc_polling.rs index ddf3f586b..07c50f224 100644 --- a/examples/mcxa/src/bin/adc_polling.rs +++ b/examples/mcxa/src/bin/adc_polling.rs @@ -4,8 +4,8 @@ use embassy_executor::Spawner; use embassy_mcxa_examples::init_adc_pins; use hal::adc::{ConvResult, LpadcConfig, TriggerPriorityPolicy}; -use hal::clocks::periph_helpers::{AdcClockSel, Div4}; use hal::clocks::PoweredClock; +use hal::clocks::periph_helpers::{AdcClockSel, Div4}; use hal::pac::adc1::cfg::{Pwrsel, Refsel}; use hal::pac::adc1::cmdl1::{Adch, Mode}; use hal::pac::adc1::ctrl::CalAvgs; diff --git a/examples/mcxa/src/bin/i2c-async.rs b/examples/mcxa/src/bin/i2c-async.rs index 47b5f3cbe..edcfd5f22 100644 --- a/examples/mcxa/src/bin/i2c-async.rs +++ b/examples/mcxa/src/bin/i2c-async.rs @@ -6,8 +6,8 @@ use embassy_time::Timer; use hal::bind_interrupts; use hal::clocks::config::Div8; use hal::config::Config; -use hal::i2c::controller::{self, I2c, Speed}; use hal::i2c::InterruptHandler; +use hal::i2c::controller::{self, I2c, Speed}; use hal::peripherals::LPI2C3; use {defmt_rtt as _, embassy_mcxa as hal, panic_probe as _}; diff --git a/examples/mcxa/src/bin/i2c-scan-blocking.rs b/examples/mcxa/src/bin/i2c-scan-blocking.rs index 4e203597b..0197f9b1d 100644 --- a/examples/mcxa/src/bin/i2c-scan-blocking.rs +++ b/examples/mcxa/src/bin/i2c-scan-blocking.rs @@ -2,8 +2,8 @@ #![no_main] use embassy_executor::Spawner; -use embassy_mcxa::gpio::Pull; use embassy_mcxa::Input; +use embassy_mcxa::gpio::Pull; use embassy_time::Timer; use hal::clocks::config::Div8; use hal::config::Config; diff --git a/examples/mcxa/src/bin/lpuart_buffered.rs b/examples/mcxa/src/bin/lpuart_buffered.rs index 420589d00..47b56b7c7 100644 --- a/examples/mcxa/src/bin/lpuart_buffered.rs +++ b/examples/mcxa/src/bin/lpuart_buffered.rs @@ -3,8 +3,8 @@ use embassy_executor::Spawner; use embassy_mcxa::clocks::config::Div8; -use embassy_mcxa::lpuart::buffered::BufferedLpuart; use embassy_mcxa::lpuart::Config; +use embassy_mcxa::lpuart::buffered::BufferedLpuart; use embassy_mcxa::{bind_interrupts, lpuart}; use embedded_io_async::Write; use {defmt_rtt as _, embassy_mcxa as hal, panic_probe as _}; -- cgit