From a62e8a93ec42bb9ec96cb8b688d2dd26e5e93bda Mon Sep 17 00:00:00 2001 From: chemicstry Date: Wed, 20 Jul 2022 23:34:13 +0300 Subject: [PATCH] Fix compilation on other flash families --- embassy-stm32/src/flash/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/embassy-stm32/src/flash/mod.rs b/embassy-stm32/src/flash/mod.rs index 26ae0862..5f412c6f 100644 --- a/embassy-stm32/src/flash/mod.rs +++ b/embassy-stm32/src/flash/mod.rs @@ -24,7 +24,10 @@ impl<'d> Flash<'d> { pub fn new(p: impl Unborrow) -> Self { unborrow!(p); - unsafe { family::init(); } + #[cfg(flash_f4)] + unsafe { + family::init(); + } Self { _inner: p, @@ -184,9 +187,9 @@ mod asynch { return Err(Error::Unaligned); } trace!("Writing {} bytes at 0x{:x}", data.len(), addr); - + self.clear_all_err(); - + unsafe { family::write(addr, data).await } } }