aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32
diff options
context:
space:
mode:
authorRasmus Melchior Jacobsen <[email protected]>2023-05-26 00:12:22 +0200
committerRasmus Melchior Jacobsen <[email protected]>2023-05-26 00:12:22 +0200
commit9115431d358628f2d0ff9f9b5d017e2f3b23472b (patch)
treea42273327bdf1bfa290c22b65248e871e149b17f /embassy-stm32
parente08267df54a78106f4c03958346c81ae7e169bd6 (diff)
Move nightly guard and clear data cache reset bit
Diffstat (limited to 'embassy-stm32')
-rw-r--r--embassy-stm32/src/flash/f4.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/embassy-stm32/src/flash/f4.rs b/embassy-stm32/src/flash/f4.rs
index a9ebaa355..35548a558 100644
--- a/embassy-stm32/src/flash/f4.rs
+++ b/embassy-stm32/src/flash/f4.rs
@@ -236,6 +236,7 @@ pub const fn get_flash_regions() -> &'static [&'static FlashRegion] {
236 &FLASH_REGIONS 236 &FLASH_REGIONS
237} 237}
238 238
239#[cfg(feature = "nightly")]
239pub(crate) unsafe fn on_interrupt() { 240pub(crate) unsafe fn on_interrupt() {
240 // Clear IRQ flags 241 // Clear IRQ flags
241 pac::FLASH.sr().write(|w| { 242 pac::FLASH.sr().write(|w| {
@@ -243,7 +244,6 @@ pub(crate) unsafe fn on_interrupt() {
243 w.set_eop(true); 244 w.set_eop(true);
244 }); 245 });
245 246
246 #[cfg(feature = "nightly")]
247 WAKER.wake(); 247 WAKER.wake();
248} 248}
249 249
@@ -436,6 +436,7 @@ fn restore_data_cache_state() {
436 unsafe { 436 unsafe {
437 // Reset data cache before we enable it again 437 // Reset data cache before we enable it again
438 pac::FLASH.acr().modify(|w| w.set_dcrst(true)); 438 pac::FLASH.acr().modify(|w| w.set_dcrst(true));
439 pac::FLASH.acr().modify(|w| w.set_dcrst(false));
439 pac::FLASH.acr().modify(|w| w.set_dcen(true)) 440 pac::FLASH.acr().modify(|w| w.set_dcen(true))
440 }; 441 };
441 } 442 }