Skip to content

Commit e576e7f

Browse files
committed
Bring in defmt derive for error types
1 parent b921d9c commit e576e7f

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

hal/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ version = "0.3"
6262
default-features = false
6363
version = "1.0"
6464

65+
[dependencies.defmt]
66+
version = "0.3"
67+
optional = true
68+
6569
[dependencies.embedded-hal-async]
6670
version = "0.1.0-alpha.3"
6771
optional = true

hal/src/dmac/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ pub use dma_controller::*;
258258
pub use transfer::*;
259259

260260
#[derive(Debug, Clone, Copy)]
261+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
261262
/// Runtime errors that may occur when dealing with DMA transfers.
262263
pub enum Error {
263264
/// Supplied buffers both have lengths > 1 beat, but not equal to each other

hal/src/sercom/i2c/flags.rs

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ impl Status {
7474

7575
/// Errors available for I2C transactions
7676
#[derive(Debug, Clone, Copy)]
77+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7778
pub enum Error {
7879
BusError,
7980
ArbitrationLost,

hal/src/sercom/spi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ impl TryFrom<Status> for () {
461461
/// The SPI peripheral only has two error types, buffer overflow and transaction
462462
/// length error.
463463
#[derive(Debug)]
464+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
464465
pub enum Error {
465466
Overflow,
466467
LengthError,

hal/src/sercom/uart/flags.rs

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ bitflags! {
8585

8686
/// Errors available for UART transactions
8787
#[derive(Debug, Clone, Copy)]
88+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
8889
pub enum Error {
8990
/// Detected a parity error
9091
ParityError,

0 commit comments

Comments
 (0)