Remove unused std_peripherals.
This commit is contained in:
parent
b916a912df
commit
a77ff72197
1 changed files with 0 additions and 39 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue