Skip to content

Commit fbc2268

Browse files
committed
Change UniformNorFlash to be a marker trait
1 parent 4f6a7a5 commit fbc2268

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
@@ -137,8 +137,15 @@ pub trait NorFlash {
137137
fn regions(&self) -> Vec<Self::Region, U4>;
138138
}
139139

140-
/// ...
141-
pub trait UniformNorFlash: NorFlash {
140+
/// Marker trait for NOR flashes with uniform erase and page sizes across the whole
141+
/// address range
142+
pub trait UniformNorFlash {}
143+
144+
/// Automatic implementation of region trait for uniform NOR flashes
145+
impl<T> NorFlashRegion for T
146+
where
147+
T: NorFlash + UniformNorFlash,
148+
{
142149
/// The range of possible addresses within the peripheral.
143150
///
144151
/// (start_addr, end_addr)

0 commit comments

Comments
 (0)