Add offset and size accessors to Partition
This commit is contained in:
parent
887ecef369
commit
c2aca45b8d
2 changed files with 20 additions and 0 deletions
|
@ -30,6 +30,16 @@ impl<'a, M: RawMutex, T: NorFlash> Partition<'a, M, T> {
|
||||||
}
|
}
|
||||||
Self { flash, offset, size }
|
Self { flash, offset, size }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the partition offset within the flash
|
||||||
|
pub const fn offset(&self) -> u32 {
|
||||||
|
self.offset
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get the partition size
|
||||||
|
pub const fn size(&self) -> u32 {
|
||||||
|
self.size
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<M: RawMutex, T: NorFlash> ErrorType for Partition<'_, M, T> {
|
impl<M: RawMutex, T: NorFlash> ErrorType for Partition<'_, M, T> {
|
||||||
|
|
|
@ -31,6 +31,16 @@ impl<'a, M: RawMutex, T: NorFlash> BlockingPartition<'a, M, T> {
|
||||||
}
|
}
|
||||||
Self { flash, offset, size }
|
Self { flash, offset, size }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the partition offset within the flash
|
||||||
|
pub const fn offset(&self) -> u32 {
|
||||||
|
self.offset
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get the partition size
|
||||||
|
pub const fn size(&self) -> u32 {
|
||||||
|
self.size
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<M: RawMutex, T: NorFlash> ErrorType for BlockingPartition<'_, M, T> {
|
impl<M: RawMutex, T: NorFlash> ErrorType for BlockingPartition<'_, M, T> {
|
||||||
|
|
Loading…
Reference in a new issue