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); - } - } - }; -}