From 995cd01cbcb2470b9ecdd953daae0cfb3aaa2e99 Mon Sep 17 00:00:00 2001 From: Dion Dokter Date: Mon, 11 Oct 2021 15:31:25 +0200 Subject: [PATCH] ran fmt --- embassy-nrf/src/buffered_uarte.rs | 2 +- embassy-nrf/src/lib.rs | 4 ++-- embassy-nrf/src/ppi.rs | 4 ++-- embassy-nrf/src/pwm.rs | 1 - embassy-nrf/src/time_driver.rs | 8 ++++++-- embassy-nrf/src/twim.rs | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index 31acb80d6..e999cb721 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs @@ -17,7 +17,7 @@ use crate::gpio::{OptionalPin as GpioOptionalPin, Pin as GpioPin}; use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task}; use crate::timer::Instance as TimerInstance; use crate::timer::{Frequency, Timer}; -use crate::uarte::{Config, Instance as UarteInstance, uarte0}; +use crate::uarte::{uarte0, Config, Instance as UarteInstance}; // Re-export SVD variants to allow user to directly set values pub use uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}; diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs index 5924a42bb..2ee04708d 100644 --- a/embassy-nrf/src/lib.rs +++ b/embassy-nrf/src/lib.rs @@ -79,10 +79,10 @@ pub(crate) use chip::pac; pub use chip::{peripherals, Peripherals}; -#[cfg(feature = "nrf9160")] -use crate::pac::CLOCK_NS as CLOCK; #[cfg(not(feature = "nrf9160"))] use crate::pac::CLOCK; +#[cfg(feature = "nrf9160")] +use crate::pac::CLOCK_NS as CLOCK; pub mod interrupt { pub use crate::chip::irqs::*; diff --git a/embassy-nrf/src/ppi.rs b/embassy-nrf/src/ppi.rs index 727f6913c..db5387b8e 100644 --- a/embassy-nrf/src/ppi.rs +++ b/embassy-nrf/src/ppi.rs @@ -18,10 +18,10 @@ use embassy_hal_common::{unborrow, unsafe_impl_unborrow}; use crate::{pac, peripherals}; -#[cfg(not(feature = "nrf9160"))] -pub(crate) use pac::PPI; #[cfg(feature = "nrf9160")] pub(crate) use pac::DPPIC_NS as PPI; +#[cfg(not(feature = "nrf9160"))] +pub(crate) use pac::PPI; // ====================== // driver diff --git a/embassy-nrf/src/pwm.rs b/embassy-nrf/src/pwm.rs index 057a13594..1bafb1d48 100644 --- a/embassy-nrf/src/pwm.rs +++ b/embassy-nrf/src/pwm.rs @@ -16,7 +16,6 @@ pub(crate) use pac::pwm0; #[cfg(feature = "nrf9160")] pub(crate) use pac::pwm0_ns as pwm0; - #[derive(Debug, Eq, PartialEq, Clone, Copy)] pub enum Prescaler { Div1, diff --git a/embassy-nrf/src/time_driver.rs b/embassy-nrf/src/time_driver.rs index 366f270c0..4c2438a00 100644 --- a/embassy-nrf/src/time_driver.rs +++ b/embassy-nrf/src/time_driver.rs @@ -16,9 +16,13 @@ pub(crate) use pac::rtc0_ns as rtc0; fn rtc() -> &'static rtc0::RegisterBlock { #[cfg(not(feature = "nrf9160"))] - unsafe { &*pac::RTC1::ptr() } + unsafe { + &*pac::RTC1::ptr() + } #[cfg(feature = "nrf9160")] - unsafe { &*pac::RTC1_NS::ptr() } + unsafe { + &*pac::RTC1_NS::ptr() + } } // RTC timekeeping works with something we call "periods", which are time intervals diff --git a/embassy-nrf/src/twim.rs b/embassy-nrf/src/twim.rs index 2d51480d8..8dcfb4143 100644 --- a/embassy-nrf/src/twim.rs +++ b/embassy-nrf/src/twim.rs @@ -184,7 +184,7 @@ impl<'d, T: Instance> Twim<'d, T> { // The PTR field is a full 32 bits wide and accepts the full range // of values. w.ptr().bits(buffer.as_mut_ptr() as u32)); - r.rxd.maxcnt.write(|w| + r.rxd.maxcnt.write(|w| // We're giving it the length of the buffer, so no danger of // accessing invalid memory. We have verified that the length of the // buffer fits in an `u8`, so the cast to the type of maxcnt