mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 14:22:33 +00:00
Add offset and size accessors to Partition
This commit is contained in:
parent
887ecef369
commit
c2aca45b8d
@ -30,6 +30,16 @@ impl<'a, M: RawMutex, T: NorFlash> Partition<'a, M, T> {
|
||||
}
|
||||
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> {
|
||||
|
@ -31,6 +31,16 @@ impl<'a, M: RawMutex, T: NorFlash> BlockingPartition<'a, M, T> {
|
||||
}
|
||||
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> {
|
||||
|
Loading…
Reference in New Issue
Block a user