From 7bee584808238103e6facdf3e25027652ffc8e21 Mon Sep 17 00:00:00 2001 From: xoviat <49173759+xoviat@users.noreply.github.com> Date: Tue, 5 Jan 2021 17:19:05 -0600 Subject: [PATCH] remove dead code in waker --- embassy-stm32f4/src/lib.rs | 50 -------------------------------------- 1 file changed, 50 deletions(-) diff --git a/embassy-stm32f4/src/lib.rs b/embassy-stm32f4/src/lib.rs index 2a5a34a2..0f4a70bb 100644 --- a/embassy-stm32f4/src/lib.rs +++ b/embassy-stm32f4/src/lib.rs @@ -308,56 +308,6 @@ compile_error!( pub use stm32f4xx_hal as hal; pub use stm32f4xx_hal::stm32 as pac; -/// Creates a new interrupt waking a [`Waker`]. -/// -/// As this interrupt will be declared in this macro, it can't be used for anything else. -/// -/// # Examples -/// -/// This macro is useful for implementing [`Future::poll`]: -/// -/// ``` -/// fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { -/// if self.is_ready() { -/// Poll::Ready(()) -/// } else { -/// waker_interrupt!(TIM2, cx.waker().clone()); -/// Poll::Pending -/// } -/// } -/// ``` -/// -/// [`Waker`]: core::task::Waker -/// [`Future::poll`]: core::future::Future::poll -// macro_rules! waker_interrupt { -// ($INT:ident, $waker:expr) => {{ -// use core::sync::atomic::{self, Ordering}; -// use core::task::Waker; -// use stm32f4xx_hal::pac::{interrupt, Interrupt, NVIC}; -// -// static mut WAKER: Option = None; -// -// #[interrupt] -// fn $INT() { -// // Safety: This context is disabled while the lower priority context accesses WAKER -// if let Some(waker) = unsafe { WAKER.as_ref() } { -// waker.wake_by_ref(); -// -// NVIC::mask(Interrupt::$INT); -// } -// } -// -// NVIC::mask(Interrupt::$INT); -// atomic::compiler_fence(Ordering::Acquire); -// // Safety: The other relevant context, the interrupt, is disabled -// unsafe { WAKER = Some($waker) } -// NVIC::unpend(Interrupt::$INT); -// atomic::compiler_fence(Ordering::Release); -// // Safety: This is the end of a mask-based critical section -// unsafe { NVIC::unmask(Interrupt::$INT) } -// }}; -// } - // This mod MUST go first, so that the others see its macros. pub(crate) mod fmt;