[stm32] Enable flash cache by default

This commit is contained in:
Erik Henriksson 2022-12-07 22:20:27 +01:00
parent 1b8c0733e6
commit b3fc0aa93d
2 changed files with 11 additions and 0 deletions

View File

@ -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);
});
}

View File

@ -161,6 +161,8 @@ pub fn init(config: Config) -> Peripherals {
// must be after rcc init
#[cfg(feature = "_time-driver")]
time_driver::init();
flash::init();
}
p