aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorokhsunrog <[email protected]>2025-05-21 00:44:24 +0300
committerokhsunrog <[email protected]>2025-05-21 00:44:24 +0300
commitd335e309012020b5eab6f0d04ee63053365140ea (patch)
tree436b220907ae27951b725bc62f1b89a573397bb4
parentc9f0afa494636533c838473bcb5d27ff8f011fb7 (diff)
only support eeprom for l0 and l1
-rw-r--r--embassy-stm32/src/flash/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/embassy-stm32/src/flash/mod.rs b/embassy-stm32/src/flash/mod.rs
index ab956664b..26f357370 100644
--- a/embassy-stm32/src/flash/mod.rs
+++ b/embassy-stm32/src/flash/mod.rs
@@ -12,9 +12,9 @@ pub use asynch::InterruptHandler;
12pub use common::*; 12pub use common::*;
13 13
14pub use crate::_generated::flash_regions::*; 14pub use crate::_generated::flash_regions::*;
15pub use crate::_generated::{FLASH_BASE, FLASH_SIZE, MAX_ERASE_SIZE, WRITE_SIZE};
16#[cfg(eeprom)] 15#[cfg(eeprom)]
17pub use crate::_generated::{EEPROM_BASE, EEPROM_SIZE}; 16pub use crate::_generated::{EEPROM_BASE, EEPROM_SIZE};
17pub use crate::_generated::{FLASH_BASE, FLASH_SIZE, MAX_ERASE_SIZE, WRITE_SIZE};
18 18
19/// Get all flash regions. 19/// Get all flash regions.
20pub fn get_flash_regions() -> &'static [&'static FlashRegion] { 20pub fn get_flash_regions() -> &'static [&'static FlashRegion] {
@@ -85,7 +85,8 @@ pub enum FlashBank {
85 /// OTP region, 85 /// OTP region,
86 Otp, 86 Otp,
87} 87}
88 88#[cfg(all(eeprom, not(any(flash_l0, flash_l1))))]
89compile_error!("The 'eeprom' cfg is enabled for a non-L0/L1 chip family. This is an unsupported configuration.");
89#[cfg_attr(any(flash_l0, flash_l1, flash_l4, flash_l5, flash_wl, flash_wb), path = "l.rs")] 90#[cfg_attr(any(flash_l0, flash_l1, flash_l4, flash_l5, flash_wl, flash_wb), path = "l.rs")]
90#[cfg_attr(flash_f0, path = "f0.rs")] 91#[cfg_attr(flash_f0, path = "f0.rs")]
91#[cfg_attr(any(flash_f1, flash_f3), path = "f1f3.rs")] 92#[cfg_attr(any(flash_f1, flash_f3), path = "f1f3.rs")]