Use critical_section
This commit is contained in:
parent
212bda0940
commit
ed29d82071
@ -62,20 +62,26 @@ crate::pac::peripheral_rcc!(
|
|||||||
($inst:ident, $enable:ident, $reset:ident, $perien:ident, $perirst:ident) => {
|
($inst:ident, $enable:ident, $reset:ident, $perien:ident, $perirst:ident) => {
|
||||||
impl sealed::RccPeripheral for peripherals::$inst {
|
impl sealed::RccPeripheral for peripherals::$inst {
|
||||||
fn enable() {
|
fn enable() {
|
||||||
unsafe {
|
critical_section::with(|_| {
|
||||||
crate::pac::RCC.$enable().modify(|w| w.$perien(true));
|
unsafe {
|
||||||
}
|
crate::pac::RCC.$enable().modify(|w| w.$perien(true));
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
fn disable() {
|
fn disable() {
|
||||||
unsafe {
|
critical_section::with(|_| {
|
||||||
crate::pac::RCC.$enable().modify(|w| w.$perien(false));
|
unsafe {
|
||||||
}
|
crate::pac::RCC.$enable().modify(|w| w.$perien(false));
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
fn reset() {
|
fn reset() {
|
||||||
unsafe {
|
critical_section::with(|_| {
|
||||||
crate::pac::RCC.$reset().modify(|w| w.$perirst(true));
|
unsafe {
|
||||||
crate::pac::RCC.$reset().modify(|w| w.$perirst(false));
|
crate::pac::RCC.$reset().modify(|w| w.$perirst(true));
|
||||||
}
|
crate::pac::RCC.$reset().modify(|w| w.$perirst(false));
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user