diff options
| author | James Munns <[email protected]> | 2023-10-06 17:45:35 +0200 |
|---|---|---|
| committer | James Munns <[email protected]> | 2023-10-06 17:45:35 +0200 |
| commit | 930b8f34953596c550ca47bb35d8ab1d19d8feed (patch) | |
| tree | ff259c5ced90358839085d598878012b238afc7d | |
| parent | 65ed19aae272d6d6320554446f9187ec2ef8bf39 (diff) | |
Add some uncontroversial derives to Error types
| -rw-r--r-- | embassy-embedded-hal/src/flash/partition/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/i2c.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/i2c_slave.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/dac/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/rng.rs | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/sai/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/spi/mod.rs | 2 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/camera.rs | 2 | ||||
| -rw-r--r-- | examples/stm32l4/src/bin/spe_adin1110_http_server.rs | 2 |
10 files changed, 10 insertions, 9 deletions
diff --git a/embassy-embedded-hal/src/flash/partition/mod.rs b/embassy-embedded-hal/src/flash/partition/mod.rs index a12e49ce1..42c8a308d 100644 --- a/embassy-embedded-hal/src/flash/partition/mod.rs +++ b/embassy-embedded-hal/src/flash/partition/mod.rs | |||
| @@ -11,7 +11,7 @@ pub use asynch::Partition; | |||
| 11 | pub use blocking::BlockingPartition; | 11 | pub use blocking::BlockingPartition; |
| 12 | 12 | ||
| 13 | /// Partition error | 13 | /// Partition error |
| 14 | #[derive(Debug)] | 14 | #[derive(Debug, PartialEq, Eq)] |
| 15 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 15 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 16 | pub enum Error<T> { | 16 | pub enum Error<T> { |
| 17 | /// The requested flash area is outside the partition | 17 | /// The requested flash area is outside the partition |
diff --git a/embassy-rp/src/i2c.rs b/embassy-rp/src/i2c.rs index c358682c5..ea077335c 100644 --- a/embassy-rp/src/i2c.rs +++ b/embassy-rp/src/i2c.rs | |||
| @@ -27,7 +27,7 @@ pub enum AbortReason { | |||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | /// I2C error | 29 | /// I2C error |
| 30 | #[derive(Debug)] | 30 | #[derive(Debug, PartialEq, Eq)] |
| 31 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 31 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 32 | pub enum Error { | 32 | pub enum Error { |
| 33 | /// I2C abort with error | 33 | /// I2C abort with error |
diff --git a/embassy-rp/src/i2c_slave.rs b/embassy-rp/src/i2c_slave.rs index 6136d69c6..30e789259 100644 --- a/embassy-rp/src/i2c_slave.rs +++ b/embassy-rp/src/i2c_slave.rs | |||
| @@ -10,7 +10,7 @@ use crate::interrupt::typelevel::{Binding, Interrupt}; | |||
| 10 | use crate::{pac, Peripheral}; | 10 | use crate::{pac, Peripheral}; |
| 11 | 11 | ||
| 12 | /// I2C error | 12 | /// I2C error |
| 13 | #[derive(Debug)] | 13 | #[derive(Debug, PartialEq, Eq)] |
| 14 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 14 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 15 | #[non_exhaustive] | 15 | #[non_exhaustive] |
| 16 | pub enum Error { | 16 | pub enum Error { |
diff --git a/embassy-stm32/src/dac/mod.rs b/embassy-stm32/src/dac/mod.rs index a2040b857..7658dce4e 100644 --- a/embassy-stm32/src/dac/mod.rs +++ b/embassy-stm32/src/dac/mod.rs | |||
| @@ -11,7 +11,7 @@ use crate::{peripherals, Peripheral}; | |||
| 11 | 11 | ||
| 12 | #[derive(Debug, Copy, Clone, Eq, PartialEq)] | 12 | #[derive(Debug, Copy, Clone, Eq, PartialEq)] |
| 13 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 13 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 14 | /// Curstom Errors | 14 | /// Custom Errors |
| 15 | pub enum Error { | 15 | pub enum Error { |
| 16 | UnconfiguredChannel, | 16 | UnconfiguredChannel, |
| 17 | InvalidValue, | 17 | InvalidValue, |
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index b35678ed9..62d13e909 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -14,7 +14,7 @@ pub use timeout::*; | |||
| 14 | 14 | ||
| 15 | use crate::peripherals; | 15 | use crate::peripherals; |
| 16 | 16 | ||
| 17 | #[derive(Debug)] | 17 | #[derive(Debug, PartialEq, Eq)] |
| 18 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 18 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 19 | pub enum Error { | 19 | pub enum Error { |
| 20 | Bus, | 20 | Bus, |
diff --git a/embassy-stm32/src/rng.rs b/embassy-stm32/src/rng.rs index 5080cf033..2d7ffc620 100644 --- a/embassy-stm32/src/rng.rs +++ b/embassy-stm32/src/rng.rs | |||
| @@ -13,6 +13,7 @@ use crate::{interrupt, pac, peripherals, Peripheral}; | |||
| 13 | 13 | ||
| 14 | static RNG_WAKER: AtomicWaker = AtomicWaker::new(); | 14 | static RNG_WAKER: AtomicWaker = AtomicWaker::new(); |
| 15 | 15 | ||
| 16 | #[derive(Debug, PartialEq, Eq)] | ||
| 16 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 17 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 17 | pub enum Error { | 18 | pub enum Error { |
| 18 | SeedError, | 19 | SeedError, |
diff --git a/embassy-stm32/src/sai/mod.rs b/embassy-stm32/src/sai/mod.rs index 5eecb637b..4c3604e50 100644 --- a/embassy-stm32/src/sai/mod.rs +++ b/embassy-stm32/src/sai/mod.rs | |||
| @@ -11,7 +11,7 @@ use crate::pac::sai::{vals, Sai as Regs}; | |||
| 11 | use crate::rcc::RccPeripheral; | 11 | use crate::rcc::RccPeripheral; |
| 12 | use crate::{peripherals, Peripheral}; | 12 | use crate::{peripherals, Peripheral}; |
| 13 | 13 | ||
| 14 | #[derive(Debug)] | 14 | #[derive(Debug, PartialEq, Eq)] |
| 15 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 15 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 16 | pub enum Error { | 16 | pub enum Error { |
| 17 | NotATransmitter, | 17 | NotATransmitter, |
diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs index 14333ba26..bd70342c1 100644 --- a/embassy-stm32/src/spi/mod.rs +++ b/embassy-stm32/src/spi/mod.rs | |||
| @@ -15,7 +15,7 @@ use crate::rcc::RccPeripheral; | |||
| 15 | use crate::time::Hertz; | 15 | use crate::time::Hertz; |
| 16 | use crate::{peripherals, Peripheral}; | 16 | use crate::{peripherals, Peripheral}; |
| 17 | 17 | ||
| 18 | #[derive(Debug)] | 18 | #[derive(Debug, PartialEq, Eq)] |
| 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 | Framing, | 21 | Framing, |
diff --git a/examples/stm32h7/src/bin/camera.rs b/examples/stm32h7/src/bin/camera.rs index de8ddc292..c22ce4e04 100644 --- a/examples/stm32h7/src/bin/camera.rs +++ b/examples/stm32h7/src/bin/camera.rs | |||
| @@ -184,7 +184,7 @@ mod ov7725 { | |||
| 184 | 184 | ||
| 185 | const CAM_ADDR: u8 = 0x21; | 185 | const CAM_ADDR: u8 = 0x21; |
| 186 | 186 | ||
| 187 | #[derive(Format)] | 187 | #[derive(Format, PartialEq, Eq)] |
| 188 | pub enum Error<I2cError: Format> { | 188 | pub enum Error<I2cError: Format> { |
| 189 | I2c(I2cError), | 189 | I2c(I2cError), |
| 190 | } | 190 | } |
diff --git a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs index 287521582..ba4a9d230 100644 --- a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs +++ b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs | |||
| @@ -366,7 +366,7 @@ pub struct ADT7422<'d, BUS: I2cBus> { | |||
| 366 | bus: BUS, | 366 | bus: BUS, |
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | #[derive(Debug, Format)] | 369 | #[derive(Debug, Format, PartialEq, Eq)] |
| 370 | pub enum Error<I2cError: Format> { | 370 | pub enum Error<I2cError: Format> { |
| 371 | I2c(I2cError), | 371 | I2c(I2cError), |
| 372 | Address, | 372 | Address, |
