diff --git a/embassy-stm32/src/spi/v2.rs b/embassy-stm32/src/spi/v2.rs index 58b98bbf..0bb5762f 100644 --- a/embassy-stm32/src/spi/v2.rs +++ b/embassy-stm32/src/spi/v2.rs @@ -4,7 +4,7 @@ use crate::gpio::{AnyPin, Pin}; use crate::pac::gpio::vals::{Afr, Moder}; use crate::pac::gpio::Gpio; use crate::pac::spi; -use crate::spi::{ByteOrder, Config, Instance, MisoPin, MosiPin, SckPin, WordSize, Error}; +use crate::spi::{ByteOrder, Config, Error, Instance, MisoPin, MosiPin, SckPin, WordSize}; use crate::time::Hertz; use core::marker::PhantomData; use embassy::util::Unborrow; diff --git a/embassy-stm32/src/spi/v3.rs b/embassy-stm32/src/spi/v3.rs index d689bfd2..6f81f9dd 100644 --- a/embassy-stm32/src/spi/v3.rs +++ b/embassy-stm32/src/spi/v3.rs @@ -4,7 +4,7 @@ use crate::gpio::{AnyPin, Pin}; use crate::pac::gpio::vals::{Afr, Moder}; use crate::pac::gpio::Gpio; use crate::pac::spi; -use crate::spi::{ByteOrder, Config, Instance, MisoPin, MosiPin, SckPin, WordSize, Error}; +use crate::spi::{ByteOrder, Config, Error, Instance, MisoPin, MosiPin, SckPin, WordSize}; use crate::time::Hertz; use core::marker::PhantomData; use embassy::util::Unborrow; @@ -38,15 +38,15 @@ pub struct Spi<'d, T: Instance> { impl<'d, T: Instance> Spi<'d, T> { pub fn new( pclk: Hertz, - peri: impl Unborrow + 'd, - sck: impl Unborrow>, - mosi: impl Unborrow>, - miso: impl Unborrow>, + peri: impl Unborrow + 'd, + sck: impl Unborrow>, + mosi: impl Unborrow>, + miso: impl Unborrow>, freq: F, config: Config, ) -> Self - where - F: Into, + where + F: Into, { unborrow!(peri); unborrow!(sck, mosi, miso); @@ -210,7 +210,7 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Transfer for Spi<'d, T> { unsafe { regs.txdr().write(|reg| reg.0 = *word as u32); } - while unsafe { ! regs.sr().read().rxp() } { + while unsafe { !regs.sr().read().rxp() } { // spin waiting for inbound to shift in. } *word = unsafe { regs.rxdr().read().0 as u8 };