[stm32] Make flash config per-family
This commit is contained in:
parent
b3fc0aa93d
commit
0f32a67e38
@ -99,3 +99,12 @@ pub(crate) unsafe fn blocking_wait_ready() -> Result<(), Error> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// safety: must be called only once at startup
|
||||
pub(crate) unsafe fn init() {
|
||||
crate::pac::FLASH.acr().modify(|w| {
|
||||
w.set_dcen(true);
|
||||
w.set_icen(true);
|
||||
w.set_prften(true);
|
||||
});
|
||||
}
|
||||
|
@ -174,3 +174,12 @@ pub(crate) unsafe fn blocking_wait_ready() -> Result<(), Error> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// safety: must be called only once at startup
|
||||
pub(crate) unsafe fn init() {
|
||||
crate::pac::FLASH.acr().modify(|w| {
|
||||
w.set_dcen(true);
|
||||
w.set_icen(true);
|
||||
w.set_prften(true);
|
||||
});
|
||||
}
|
||||
|
@ -133,3 +133,12 @@ pub(crate) unsafe fn blocking_wait_ready() -> Result<(), Error> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// safety: must be called only once at startup
|
||||
pub(crate) unsafe fn init() {
|
||||
crate::pac::FLASH.acr().modify(|w| {
|
||||
w.set_dcen(true);
|
||||
w.set_icen(true);
|
||||
w.set_prften(true);
|
||||
});
|
||||
}
|
||||
|
@ -199,3 +199,6 @@ pub(crate) unsafe fn blocking_wait_ready(bank: pac::flash::Bank) -> Result<(), E
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// safety: must be called only once at startup
|
||||
pub(crate) unsafe fn init() {}
|
||||
|
@ -185,3 +185,12 @@ pub(crate) unsafe fn blocking_wait_ready() -> Result<(), Error> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// safety: must be called only once at startup
|
||||
pub(crate) unsafe fn init() {
|
||||
crate::pac::FLASH.acr().modify(|w| {
|
||||
w.set_dcen(true);
|
||||
w.set_icen(true);
|
||||
w.set_prften(true);
|
||||
});
|
||||
}
|
||||
|
@ -181,9 +181,5 @@ cfg_if::cfg_if! {
|
||||
|
||||
// safety: must be called only once at startup
|
||||
pub(crate) unsafe fn init() {
|
||||
crate::pac::FLASH.acr().modify(|w| {
|
||||
w.set_dcen(true);
|
||||
w.set_icen(true);
|
||||
w.set_prften(true);
|
||||
});
|
||||
family::init();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user