Remove unused std_peripherals.

This commit is contained in:
Dario Nieuwenhuis 2022-07-22 15:37:32 +02:00
parent b916a912df
commit a77ff72197

View File

@ -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<Clocks> = 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);
}
}
};
}