Update to new api

This commit is contained in:
Ulf Lilleengen
2021-06-07 12:03:31 +02:00
parent f752700df5
commit f5e2fb9a5a
4 changed files with 32 additions and 44 deletions

View File

@ -28,8 +28,6 @@ pub struct Power {
impl Power {
pub fn new(_peri: peripherals::PWR, enable_overdrive: bool) -> Self {
use crate::pac::rcc::vals::Apb4enrSyscfgen;
// NOTE(unsafe) we have the PWR singleton
unsafe {
// NB. The lower bytes of CR3 can only be written once after
@ -57,8 +55,7 @@ impl Power {
VoltageScale::Scale1
} else {
critical_section::with(|_| {
RCC.apb4enr()
.modify(|w| w.set_syscfgen(Apb4enrSyscfgen::ENABLED));
RCC.apb4enr().modify(|w| w.set_syscfgen(true));
SYSCFG.pwrcr().modify(|w| w.set_oden(1));
});