Add defmt feature (as optional dep) and allow i2c::Error to be formatted (#328)

This commit is contained in:
Wilfried Chauveau 2022-05-09 10:22:41 +01:00 committed by GitHub
parent cd692427f6
commit 38692dfcb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -30,6 +30,8 @@ critical-section = { version = "0.2.4", features = ["custom-impl"] }
futures = { version = "0.3", default-features = false, optional = true } futures = { version = "0.3", default-features = false, optional = true }
chrono = { version = "0.4", 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] [dev-dependencies]
cortex-m-rt = "0.7" cortex-m-rt = "0.7"
panic-halt = "0.2.0" panic-halt = "0.2.0"

View file

@ -66,6 +66,7 @@ pub mod peripheral;
/// I2C error /// I2C error
#[non_exhaustive] #[non_exhaustive]
#[derive(Debug)] #[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error { pub enum Error {
/// I2C abort with error /// I2C abort with error
Abort(u32), Abort(u32),