diff options
| author | dvdsk <[email protected]> | 2024-06-06 23:19:07 +0200 |
|---|---|---|
| committer | dvdsk <[email protected]> | 2024-06-06 23:19:07 +0200 |
| commit | 871fe3a5493961e81ec41ddc8f000f32b0549e71 (patch) | |
| tree | 292f86c49b26c9382d54c39e977a9448919c6f29 /embassy-stm32/src | |
| parent | 5f9bc6def7ea8698a6ce45d8e12e1d1bd8cce876 (diff) | |
Add Clone and Copy to Error types
None of them are `non-exaustative`, they are all small enough to be copy
(I estimate none are larger than 4 bytes).
Diffstat (limited to 'embassy-stm32/src')
| -rw-r--r-- | embassy-stm32/src/dsihost.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/rng.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/sai/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/spi/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/tsc/mod.rs | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/embassy-stm32/src/dsihost.rs b/embassy-stm32/src/dsihost.rs index e1fb3b0b0..7be51ba6d 100644 --- a/embassy-stm32/src/dsihost.rs +++ b/embassy-stm32/src/dsihost.rs | |||
| @@ -388,7 +388,7 @@ impl<'d, T: Instance> DsiHost<'d, T> { | |||
| 388 | 388 | ||
| 389 | /// Possible Error Types for DSI HOST | 389 | /// Possible Error Types for DSI HOST |
| 390 | #[non_exhaustive] | 390 | #[non_exhaustive] |
| 391 | #[derive(Debug)] | 391 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] |
| 392 | pub enum Error { | 392 | pub enum Error { |
| 393 | /// Waiting for FIFO empty flag timed out | 393 | /// Waiting for FIFO empty flag timed out |
| 394 | FifoTimeout, | 394 | FifoTimeout, |
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index 6d12af2cc..f43cb4567 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -23,7 +23,7 @@ use crate::time::Hertz; | |||
| 23 | use crate::{interrupt, peripherals}; | 23 | use crate::{interrupt, peripherals}; |
| 24 | 24 | ||
| 25 | /// I2C error. | 25 | /// I2C error. |
| 26 | #[derive(Debug, PartialEq, Eq)] | 26 | #[derive(Debug, PartialEq, Eq, Copy, Clone)] |
| 27 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 27 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 28 | pub enum Error { | 28 | pub enum Error { |
| 29 | /// Bus error | 29 | /// Bus error |
diff --git a/embassy-stm32/src/rng.rs b/embassy-stm32/src/rng.rs index 94491c32f..6f4c81c8a 100644 --- a/embassy-stm32/src/rng.rs +++ b/embassy-stm32/src/rng.rs | |||
| @@ -15,7 +15,7 @@ use crate::{interrupt, pac, peripherals, rcc, Peripheral}; | |||
| 15 | static RNG_WAKER: AtomicWaker = AtomicWaker::new(); | 15 | static RNG_WAKER: AtomicWaker = AtomicWaker::new(); |
| 16 | 16 | ||
| 17 | /// RNG error | 17 | /// RNG error |
| 18 | #[derive(Debug, PartialEq, Eq)] | 18 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] |
| 19 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 19 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 20 | pub enum Error { | 20 | pub enum Error { |
| 21 | /// Seed error. | 21 | /// Seed error. |
diff --git a/embassy-stm32/src/sai/mod.rs b/embassy-stm32/src/sai/mod.rs index 3faecdc33..87bde12eb 100644 --- a/embassy-stm32/src/sai/mod.rs +++ b/embassy-stm32/src/sai/mod.rs | |||
| @@ -15,7 +15,7 @@ use crate::rcc::{self, RccPeripheral}; | |||
| 15 | use crate::{peripherals, Peripheral}; | 15 | use crate::{peripherals, Peripheral}; |
| 16 | 16 | ||
| 17 | /// SAI error | 17 | /// SAI error |
| 18 | #[derive(Debug, PartialEq, Eq)] | 18 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] |
| 19 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 19 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 20 | pub enum Error { | 20 | pub enum Error { |
| 21 | /// `write` called on a SAI in receive mode. | 21 | /// `write` called on a SAI in receive mode. |
diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs index 4eaf7777f..03c908db8 100644 --- a/embassy-stm32/src/spi/mod.rs +++ b/embassy-stm32/src/spi/mod.rs | |||
| @@ -18,7 +18,7 @@ use crate::time::Hertz; | |||
| 18 | use crate::Peripheral; | 18 | use crate::Peripheral; |
| 19 | 19 | ||
| 20 | /// SPI error. | 20 | /// SPI error. |
| 21 | #[derive(Debug, PartialEq, Eq)] | 21 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] |
| 22 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 22 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 23 | pub enum Error { | 23 | pub enum Error { |
| 24 | /// Invalid framing. | 24 | /// Invalid framing. |
diff --git a/embassy-stm32/src/tsc/mod.rs b/embassy-stm32/src/tsc/mod.rs index 045d6317c..8cab3a24c 100644 --- a/embassy-stm32/src/tsc/mod.rs +++ b/embassy-stm32/src/tsc/mod.rs | |||
| @@ -83,7 +83,7 @@ const TSC_NUM_GROUPS: u32 = 7; | |||
| 83 | const TSC_NUM_GROUPS: u32 = 8; | 83 | const TSC_NUM_GROUPS: u32 = 8; |
| 84 | 84 | ||
| 85 | /// Error type defined for TSC | 85 | /// Error type defined for TSC |
| 86 | #[derive(Debug)] | 86 | #[derive(Debug, Clone, Copy)] |
| 87 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 87 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 88 | pub enum Error { | 88 | pub enum Error { |
| 89 | /// Test error for TSC | 89 | /// Test error for TSC |
