Hand-roll Clone impl instead of derive
This commit is contained in:
parent
20bf995c3b
commit
ccc2ddab66
2 changed files with 20 additions and 2 deletions
embassy-embedded-hal/src/flash/partition
|
@ -12,13 +12,22 @@ use super::Error;
|
||||||
/// There is no guarantee that muliple partitions on the same flash
|
/// There is no guarantee that muliple partitions on the same flash
|
||||||
/// operate on mutually exclusive ranges - such a separation is up to
|
/// operate on mutually exclusive ranges - such a separation is up to
|
||||||
/// the user to guarantee.
|
/// the user to guarantee.
|
||||||
#[derive(Clone)]
|
|
||||||
pub struct Partition<'a, M: RawMutex, T: NorFlash> {
|
pub struct Partition<'a, M: RawMutex, T: NorFlash> {
|
||||||
flash: &'a Mutex<M, T>,
|
flash: &'a Mutex<M, T>,
|
||||||
offset: u32,
|
offset: u32,
|
||||||
size: u32,
|
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> {
|
impl<'a, M: RawMutex, T: NorFlash> Partition<'a, M, T> {
|
||||||
/// Create a new partition
|
/// Create a new partition
|
||||||
pub const fn new(flash: &'a Mutex<M, T>, offset: u32, size: u32) -> Self {
|
pub const fn new(flash: &'a Mutex<M, T>, offset: u32, size: u32) -> Self {
|
||||||
|
|
|
@ -13,13 +13,22 @@ use super::Error;
|
||||||
/// There is no guarantee that muliple partitions on the same flash
|
/// There is no guarantee that muliple partitions on the same flash
|
||||||
/// operate on mutually exclusive ranges - such a separation is up to
|
/// operate on mutually exclusive ranges - such a separation is up to
|
||||||
/// the user to guarantee.
|
/// the user to guarantee.
|
||||||
#[derive(Clone)]
|
|
||||||
pub struct BlockingPartition<'a, M: RawMutex, T: NorFlash> {
|
pub struct BlockingPartition<'a, M: RawMutex, T: NorFlash> {
|
||||||
flash: &'a Mutex<M, RefCell<T>>,
|
flash: &'a Mutex<M, RefCell<T>>,
|
||||||
offset: u32,
|
offset: u32,
|
||||||
size: u32,
|
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> {
|
impl<'a, M: RawMutex, T: NorFlash> BlockingPartition<'a, M, T> {
|
||||||
/// Create a new partition
|
/// Create a new partition
|
||||||
pub const fn new(flash: &'a Mutex<M, RefCell<T>>, offset: u32, size: u32) -> Self {
|
pub const fn new(flash: &'a Mutex<M, RefCell<T>>, offset: u32, size: u32) -> Self {
|
||||||
|
|
Loading…
Add table
Reference in a new issue