Skip to content

Commit 0a1d619

Browse files
committed
Change UniformNorFlash to be a marker trait
1 parent e805677 commit 0a1d619

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,15 @@ pub trait NorFlash {
199199
fn regions(&self) -> Vec<Self::Region, U4>;
200200
}
201201

202-
/// ...
203-
pub trait UniformNorFlash: NorFlash {
202+
/// Marker trait for NOR flashes with uniform erase and page sizes across the whole
203+
/// address range
204+
pub trait UniformNorFlash {}
205+
206+
/// Automatic implementation of region trait for uniform NOR flashes
207+
impl<T> NorFlashRegion for T
208+
where
209+
T: NorFlash + UniformNorFlash,
210+
{
204211
/// The range of possible addresses within the peripheral.
205212
///
206213
/// (start_addr, end_addr)

0 commit comments

Comments
 (0)