From 6e13f5b387d8f0f948b5874bc300925b015947d9 Mon Sep 17 00:00:00 2001 From: xoviat Date: Fri, 30 Jun 2023 18:33:22 -0500 Subject: [PATCH] rustfmt --- embassy-stm32/src/pwm/mod.rs | 4 ---- embassy-stm32/src/rcc/f3.rs | 1 + embassy-stm32/src/timer/mod.rs | 3 --- examples/stm32f334/src/bin/pwm.rs | 4 +--- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/embassy-stm32/src/pwm/mod.rs b/embassy-stm32/src/pwm/mod.rs index 2586dc153..d09e38d0e 100644 --- a/embassy-stm32/src/pwm/mod.rs +++ b/embassy-stm32/src/pwm/mod.rs @@ -3,9 +3,6 @@ pub mod advanced_pwm; pub mod complementary_pwm; pub mod simple_pwm; -#[cfg(hrtim_v1)] -use core::ops; - use stm32_metapac::timer::vals::Ckd; #[cfg(hrtim_v1)] @@ -402,7 +399,6 @@ foreach_interrupt! { } fn set_channel_dead_time(channel: usize, dead_time: u16) { - use crate::rcc::sealed::RccPeripheral; use crate::timer::sealed::HighResolutionControlInstance; let regs = Self::regs(); diff --git a/embassy-stm32/src/rcc/f3.rs b/embassy-stm32/src/rcc/f3.rs index 2deee80d6..321270a70 100644 --- a/embassy-stm32/src/rcc/f3.rs +++ b/embassy-stm32/src/rcc/f3.rs @@ -264,6 +264,7 @@ fn calc_pll(config: &Config, Hertz(sysclk): Hertz) -> (Hertz, PllConfig) { } #[inline] +#[allow(unused_variables)] fn get_usb_pre(config: &Config, sysclk: u32, pclk1: u32, pll_config: &Option) -> Usbpre { cfg_if::cfg_if! { // Some chips do not have USB diff --git a/embassy-stm32/src/timer/mod.rs b/embassy-stm32/src/timer/mod.rs index 89cb16668..a92f854ec 100644 --- a/embassy-stm32/src/timer/mod.rs +++ b/embassy-stm32/src/timer/mod.rs @@ -1,6 +1,3 @@ -#[cfg(hrtim_v1)] -use core::ops; - use stm32_metapac::timer::vals; use crate::interrupt; diff --git a/examples/stm32f334/src/bin/pwm.rs b/examples/stm32f334/src/bin/pwm.rs index 20a621372..1b5d509e7 100644 --- a/examples/stm32f334/src/bin/pwm.rs +++ b/examples/stm32f334/src/bin/pwm.rs @@ -5,9 +5,7 @@ use defmt::*; use embassy_executor::Spawner; use embassy_stm32::pwm::advanced_pwm::*; -use embassy_stm32::pwm::Channel; use embassy_stm32::time::khz; -use embassy_time::{Duration, Timer}; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] @@ -17,7 +15,7 @@ async fn main(_spawner: Spawner) { let ch1 = PwmPin::new_cha(p.PA8); let ch1n = ComplementaryPwmPin::new_cha(p.PA9); - let mut pwm = AdvancedPwm::new( + let pwm = AdvancedPwm::new( p.HRTIM1, Some(ch1), Some(ch1n),