mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-02-16 17:02:30 +00:00
Merge pull request #3195 from MathiasKoch/chore/flash-partition-clone
chore(embassy-embedded-hal): Add Clone impl to flash Partition
This commit is contained in:
commit
94b2143463
@ -18,6 +18,16 @@ pub struct Partition<'a, M: RawMutex, T: NorFlash> {
|
||||
size: u32,
|
||||
}
|
||||
|
||||
impl<'a, M: RawMutex, T: NorFlash> Clone for Partition<'a, M, T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
flash: self.flash,
|
||||
offset: self.offset,
|
||||
size: self.size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, M: RawMutex, T: NorFlash> Partition<'a, M, T> {
|
||||
/// Create a new partition
|
||||
pub const fn new(flash: &'a Mutex<M, T>, offset: u32, size: u32) -> Self {
|
||||
|
@ -19,6 +19,16 @@ pub struct BlockingPartition<'a, M: RawMutex, T: NorFlash> {
|
||||
size: u32,
|
||||
}
|
||||
|
||||
impl<'a, M: RawMutex, T: NorFlash> Clone for BlockingPartition<'a, M, T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
flash: self.flash,
|
||||
offset: self.offset,
|
||||
size: self.size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, M: RawMutex, T: NorFlash> BlockingPartition<'a, M, T> {
|
||||
/// Create a new partition
|
||||
pub const fn new(flash: &'a Mutex<M, RefCell<T>>, offset: u32, size: u32) -> Self {
|
||||
|
Loading…
Reference in New Issue
Block a user