Ensure flash module and FlashRegion trait is always defined

This commit is contained in:
Rasmus Melchior Jacobsen 2023-03-25 16:32:32 +01:00
parent bc69eb596e
commit e8fc7a66a3
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,7 @@
pub trait FlashRegion {
const BASE: usize;
const SIZE: usize;
const ERASE_SIZE: usize;
const WRITE_SIZE: usize;
const ERASE_VALUE: u8;
}

View file

@ -47,6 +47,13 @@ pub mod crc;
flash_l0, flash_l1, flash_wl, flash_wb, flash_l4, flash_f3, flash_f4, flash_f7, flash_h7
))]
pub mod flash;
#[cfg(not(any(
flash_l0, flash_l1, flash_wl, flash_wb, flash_l4, flash_f3, flash_f4, flash_f7, flash_h7
)))]
pub mod flash {
mod other;
pub use other::FlashRegion;
}
pub mod pwm;
#[cfg(rng)]
pub mod rng;