diff --git a/rp2040-hal/Cargo.toml b/rp2040-hal/Cargo.toml index 6ea6523..7b29844 100644 --- a/rp2040-hal/Cargo.toml +++ b/rp2040-hal/Cargo.toml @@ -30,6 +30,8 @@ critical-section = { version = "0.2.4", features = ["custom-impl"] } futures = { version = "0.3", default-features = false, optional = true } chrono = { version = "0.4", default-features = false, optional = true } +defmt = { version = ">=0.2.0, <0.4", optional = true } + [dev-dependencies] cortex-m-rt = "0.7" panic-halt = "0.2.0" diff --git a/rp2040-hal/src/i2c.rs b/rp2040-hal/src/i2c.rs index 463f287..6ceefe2 100644 --- a/rp2040-hal/src/i2c.rs +++ b/rp2040-hal/src/i2c.rs @@ -66,6 +66,7 @@ pub mod peripheral; /// I2C error #[non_exhaustive] #[derive(Debug)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum Error { /// I2C abort with error Abort(u32),