take clocks on peripheral take

This commit is contained in:
xoviat 2021-03-29 09:02:23 -05:00
parent 50ecb7d42b
commit a3d876bf46

View File

@ -122,7 +122,7 @@ macro_rules! std_peripherals {
impl Peripherals { impl Peripherals {
pub fn take() -> Option<(Peripherals, Clocks)> { pub fn take() -> Option<(Peripherals, Clocks)> {
match unsafe {GLOBAL_CLOCKS} { match unsafe {GLOBAL_CLOCKS.take()} {
Some(clocks) => { Some(clocks) => {
let dp = unsafe { pac::Peripherals::steal() }; let dp = unsafe { pac::Peripherals::steal() };
let peripherals = Peripherals { let peripherals = Peripherals {