From a8703b75988e1e700af701116464025679d2feb8 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 12 Jun 2022 22:15:44 +0200 Subject: Run rustfmt. --- embassy-cortex-m/src/executor.rs | 4 ++-- embassy-cortex-m/src/interrupt.rs | 5 ++--- embassy-cortex-m/src/peripheral.rs | 11 +++++------ 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'embassy-cortex-m/src') diff --git a/embassy-cortex-m/src/executor.rs b/embassy-cortex-m/src/executor.rs index 63a1519cf..34f3ec236 100644 --- a/embassy-cortex-m/src/executor.rs +++ b/embassy-cortex-m/src/executor.rs @@ -1,9 +1,9 @@ use core::marker::PhantomData; -use crate::interrupt::{Interrupt, InterruptExt}; +pub use embassy::executor::Executor; use embassy::executor::{raw, SendSpawner}; -pub use embassy::executor::Executor; +use crate::interrupt::{Interrupt, InterruptExt}; fn pend_by_number(n: u16) { #[derive(Clone, Copy)] diff --git a/embassy-cortex-m/src/interrupt.rs b/embassy-cortex-m/src/interrupt.rs index df2aad0ec..72686b402 100644 --- a/embassy-cortex-m/src/interrupt.rs +++ b/embassy-cortex-m/src/interrupt.rs @@ -1,9 +1,8 @@ +use core::{mem, ptr}; + use atomic_polyfill::{compiler_fence, AtomicPtr, Ordering}; -use core::mem; -use core::ptr; use cortex_m::peripheral::NVIC; use embassy_hal_common::Unborrow; - pub use embassy_macros::cortex_m_interrupt_take as take; /// Implementation detail, do not use outside embassy crates. diff --git a/embassy-cortex-m/src/peripheral.rs b/embassy-cortex-m/src/peripheral.rs index 40277691c..5ff690831 100644 --- a/embassy-cortex-m/src/peripheral.rs +++ b/embassy-cortex-m/src/peripheral.rs @@ -1,5 +1,6 @@ use core::marker::PhantomData; use core::mem::MaybeUninit; + use cortex_m::peripheral::scb::VectActive; use cortex_m::peripheral::{NVIC, SCB}; @@ -53,13 +54,11 @@ impl<'a, S: PeripheralState> PeripheralMutex<'a, S> { /// Create a new `PeripheralMutex` wrapping `irq`, with `init` initializing the initial state. /// /// Registers `on_interrupt` as the `irq`'s handler, and enables it. - pub fn new( - irq: S::Interrupt, - storage: &'a mut StateStorage, - init: impl FnOnce() -> S, - ) -> Self { + pub fn new(irq: S::Interrupt, storage: &'a mut StateStorage, init: impl FnOnce() -> S) -> Self { if can_be_preempted(&irq) { - panic!("`PeripheralMutex` cannot be created in an interrupt with higher priority than the interrupt it wraps"); + panic!( + "`PeripheralMutex` cannot be created in an interrupt with higher priority than the interrupt it wraps" + ); } let state_ptr = storage.0.as_mut_ptr(); -- cgit