diff --git a/embassy-stm32/src/flash/mod.rs b/embassy-stm32/src/flash/mod.rs index c704909a..1294ace4 100644 --- a/embassy-stm32/src/flash/mod.rs +++ b/embassy-stm32/src/flash/mod.rs @@ -108,6 +108,12 @@ impl Drop for Flash<'_> { } } +impl Drop for FlashRegions { + fn drop(&mut self) { + unsafe { family::lock() }; + } +} + pub trait FlashRegion { const BASE: usize; const SIZE: usize;