diff options
| author | Mathias <[email protected]> | 2024-07-18 12:14:56 +0200 |
|---|---|---|
| committer | Mathias <[email protected]> | 2024-07-18 12:14:56 +0200 |
| commit | ccc2ddab6694a0588d191aec5ab3fa2c82c60b18 (patch) | |
| tree | b979ab442932e45628fe6af63acca85855db4944 /embassy-embedded-hal/src/flash/partition/blocking.rs | |
| parent | 20bf995c3be1eb5d0c156910ba219d10abdba20c (diff) | |
Hand-roll Clone impl instead of derive
Diffstat (limited to 'embassy-embedded-hal/src/flash/partition/blocking.rs')
| -rw-r--r-- | embassy-embedded-hal/src/flash/partition/blocking.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/embassy-embedded-hal/src/flash/partition/blocking.rs b/embassy-embedded-hal/src/flash/partition/blocking.rs index 478f39246..a68df7812 100644 --- a/embassy-embedded-hal/src/flash/partition/blocking.rs +++ b/embassy-embedded-hal/src/flash/partition/blocking.rs | |||
| @@ -13,13 +13,22 @@ use super::Error; | |||
| 13 | /// There is no guarantee that muliple partitions on the same flash | 13 | /// There is no guarantee that muliple partitions on the same flash |
| 14 | /// operate on mutually exclusive ranges - such a separation is up to | 14 | /// operate on mutually exclusive ranges - such a separation is up to |
| 15 | /// the user to guarantee. | 15 | /// the user to guarantee. |
| 16 | #[derive(Clone)] | ||
| 17 | pub struct BlockingPartition<'a, M: RawMutex, T: NorFlash> { | 16 | pub struct BlockingPartition<'a, M: RawMutex, T: NorFlash> { |
| 18 | flash: &'a Mutex<M, RefCell<T>>, | 17 | flash: &'a Mutex<M, RefCell<T>>, |
| 19 | offset: u32, | 18 | offset: u32, |
| 20 | size: u32, | 19 | size: u32, |
| 21 | } | 20 | } |
| 22 | 21 | ||
| 22 | impl<'a, M: RawMutex, T: NorFlash> Clone for BlockingPartition<'a, M, T> { | ||
| 23 | fn clone(&self) -> Self { | ||
| 24 | Self { | ||
| 25 | flash: self.flash, | ||
| 26 | offset: self.offset, | ||
| 27 | size: self.size, | ||
| 28 | } | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 23 | impl<'a, M: RawMutex, T: NorFlash> BlockingPartition<'a, M, T> { | 32 | impl<'a, M: RawMutex, T: NorFlash> BlockingPartition<'a, M, T> { |
| 24 | /// Create a new partition | 33 | /// Create a new partition |
| 25 | pub const fn new(flash: &'a Mutex<M, RefCell<T>>, offset: u32, size: u32) -> Self { | 34 | pub const fn new(flash: &'a Mutex<M, RefCell<T>>, offset: u32, size: u32) -> Self { |
