[stm32] Enable flash cache by default
This commit is contained in:
parent
1b8c0733e6
commit
b3fc0aa93d
@ -178,3 +178,12 @@ 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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -161,6 +161,8 @@ pub fn init(config: Config) -> Peripherals {
|
|||||||
// must be after rcc init
|
// must be after rcc init
|
||||||
#[cfg(feature = "_time-driver")]
|
#[cfg(feature = "_time-driver")]
|
||||||
time_driver::init();
|
time_driver::init();
|
||||||
|
|
||||||
|
flash::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
p
|
p
|
||||||
|
Loading…
Reference in New Issue
Block a user