From a77ff721977e6071feb7000059d7e6185965949f Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 22 Jul 2022 15:37:32 +0200 Subject: [PATCH] Remove unused std_peripherals. --- embassy-hal-common/src/macros.rs | 39 -------------------------------- 1 file changed, 39 deletions(-) diff --git a/embassy-hal-common/src/macros.rs b/embassy-hal-common/src/macros.rs index c054a87c..51e4a5ee 100644 --- a/embassy-hal-common/src/macros.rs +++ b/embassy-hal-common/src/macros.rs @@ -89,42 +89,3 @@ macro_rules! unsafe_impl_unborrow { } }; } - -#[macro_export] -macro_rules! std_peripherals { - ($($(#[$cfg:meta])? $name:ident),*$(,)?) => { - #[doc = r"All the peripherals"] - #[allow(non_snake_case)] - pub struct Peripherals { - $( - $(#[$cfg])? - pub $name: pac::$name, - )+ - } - - static mut GLOBAL_CLOCKS: Option = None; - - impl Peripherals { - pub fn take() -> Option<(Peripherals, Clocks)> { - match unsafe {GLOBAL_CLOCKS.take()} { - Some(clocks) => { - let dp = unsafe { pac::Peripherals::steal() }; - let peripherals = Peripherals { - $( - $(#[$cfg])? - $name: dp.$name, - )+ - }; - - Some((peripherals, clocks)) - }, - None => None, - } - } - - pub unsafe fn set_peripherals(clocks: Clocks) { - GLOBAL_CLOCKS.replace(clocks); - } - } - }; -}