Merge pull request #2018 from jamesmunns/add-derives

Add some uncontroversial derives to Error types
This commit is contained in:
Dario Nieuwenhuis 2023-10-07 00:03:10 +00:00 committed by GitHub
commit 85c6f23dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 11 additions and 10 deletions

View File

@ -11,7 +11,7 @@ pub use asynch::Partition;
pub use blocking::BlockingPartition;
/// Partition error
#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error<T> {
/// The requested flash area is outside the partition

View File

@ -12,7 +12,7 @@ use crate::interrupt::typelevel::{Binding, Interrupt};
use crate::{interrupt, pac, peripherals, Peripheral};
/// I2C error abort reason
#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum AbortReason {
/// A bus operation was not acknowledged, e.g. due to the addressed device
@ -27,7 +27,7 @@ pub enum AbortReason {
}
/// I2C error
#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
/// I2C abort with error

View File

@ -10,7 +10,7 @@ use crate::interrupt::typelevel::{Binding, Interrupt};
use crate::{pac, Peripheral};
/// I2C error
#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[non_exhaustive]
pub enum Error {

View File

@ -11,7 +11,7 @@ use crate::{peripherals, Peripheral};
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
/// Curstom Errors
/// Custom Errors
pub enum Error {
UnconfiguredChannel,
InvalidValue,

View File

@ -14,7 +14,7 @@ pub use timeout::*;
use crate::peripherals;
#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
Bus,

View File

@ -13,6 +13,7 @@ use crate::{interrupt, pac, peripherals, Peripheral};
static RNG_WAKER: AtomicWaker = AtomicWaker::new();
#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
SeedError,

View File

@ -11,7 +11,7 @@ use crate::pac::sai::{vals, Sai as Regs};
use crate::rcc::RccPeripheral;
use crate::{peripherals, Peripheral};
#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
NotATransmitter,

View File

@ -15,7 +15,7 @@ use crate::rcc::RccPeripheral;
use crate::time::Hertz;
use crate::{peripherals, Peripheral};
#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
Framing,

View File

@ -184,7 +184,7 @@ mod ov7725 {
const CAM_ADDR: u8 = 0x21;
#[derive(Format)]
#[derive(Format, PartialEq, Eq)]
pub enum Error<I2cError: Format> {
I2c(I2cError),
}

View File

@ -366,7 +366,7 @@ pub struct ADT7422<'d, BUS: I2cBus> {
bus: BUS,
}
#[derive(Debug, Format)]
#[derive(Debug, Format, PartialEq, Eq)]
pub enum Error<I2cError: Format> {
I2c(I2cError),
Address,