diff options
| author | Matous Hybl <[email protected]> | 2022-07-19 21:15:47 +0200 |
|---|---|---|
| committer | Matous Hybl <[email protected]> | 2022-07-24 22:10:50 +0200 |
| commit | c38755c5b737edbc88753c154feff93a5ced2a38 (patch) | |
| tree | e31d6ee5ac96e7e71e40c27954e13f4209909372 | |
| parent | 26fdfdb00a1819f4a21c8d0fe1220c079983eecc (diff) | |
Add defmt support to embassy-embedded-hal errors
| -rw-r--r-- | embassy-embedded-hal/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-embedded-hal/src/shared_bus/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-stm32/Cargo.toml | 2 |
4 files changed, 7 insertions, 3 deletions
diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml index d2606d264..455786be9 100644 --- a/embassy-embedded-hal/Cargo.toml +++ b/embassy-embedded-hal/Cargo.toml | |||
| @@ -15,4 +15,6 @@ embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } | |||
| 15 | embedded-hal-async = { version = "0.1.0-alpha.1", optional = true } | 15 | embedded-hal-async = { version = "0.1.0-alpha.1", optional = true } |
| 16 | embedded-storage = "0.3.0" | 16 | embedded-storage = "0.3.0" |
| 17 | embedded-storage-async = { version = "0.3.0", optional = true } | 17 | embedded-storage-async = { version = "0.3.0", optional = true } |
| 18 | nb = "1.0.0" \ No newline at end of file | 18 | nb = "1.0.0" |
| 19 | |||
| 20 | defmt = { version = "0.3", optional = true } | ||
diff --git a/embassy-embedded-hal/src/shared_bus/mod.rs b/embassy-embedded-hal/src/shared_bus/mod.rs index 76ee413d9..617d921e9 100644 --- a/embassy-embedded-hal/src/shared_bus/mod.rs +++ b/embassy-embedded-hal/src/shared_bus/mod.rs | |||
| @@ -10,6 +10,7 @@ pub mod blocking; | |||
| 10 | 10 | ||
| 11 | /// Error returned by I2C device implementations in this crate. | 11 | /// Error returned by I2C device implementations in this crate. |
| 12 | #[derive(Copy, Clone, Eq, PartialEq, Debug)] | 12 | #[derive(Copy, Clone, Eq, PartialEq, Debug)] |
| 13 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 13 | pub enum I2cDeviceError<BUS> { | 14 | pub enum I2cDeviceError<BUS> { |
| 14 | /// An operation on the inner I2C bus failed. | 15 | /// An operation on the inner I2C bus failed. |
| 15 | I2c(BUS), | 16 | I2c(BUS), |
| @@ -28,6 +29,7 @@ where | |||
| 28 | 29 | ||
| 29 | /// Error returned by SPI device implementations in this crate. | 30 | /// Error returned by SPI device implementations in this crate. |
| 30 | #[derive(Copy, Clone, Eq, PartialEq, Debug)] | 31 | #[derive(Copy, Clone, Eq, PartialEq, Debug)] |
| 32 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 31 | pub enum SpiDeviceError<BUS, CS> { | 33 | pub enum SpiDeviceError<BUS, CS> { |
| 32 | /// An operation on the inner SPI bus failed. | 34 | /// An operation on the inner SPI bus failed. |
| 33 | Spi(BUS), | 35 | Spi(BUS), |
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index 3569a70c6..b2b6db1cd 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml | |||
| @@ -18,7 +18,7 @@ flavors = [ | |||
| 18 | 18 | ||
| 19 | time = ["embassy/time"] | 19 | time = ["embassy/time"] |
| 20 | 20 | ||
| 21 | defmt = ["dep:defmt", "embassy/defmt", "embassy-usb?/defmt", "embedded-io?/defmt"] | 21 | defmt = ["dep:defmt", "embassy/defmt", "embassy-usb?/defmt", "embedded-io?/defmt", "embassy-embedded-hal/defmt"] |
| 22 | 22 | ||
| 23 | # Enable nightly-only features | 23 | # Enable nightly-only features |
| 24 | nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-usb", "embedded-storage-async", "dep:embedded-io", "embassy-embedded-hal/nightly"] | 24 | nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-usb", "embedded-storage-async", "dep:embedded-io", "embassy-embedded-hal/nightly"] |
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index a5c444fbb..e9c3fdf45 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -72,7 +72,7 @@ quote = "1.0.15" | |||
| 72 | stm32-metapac = { version = "0.1.0", path = "../stm32-metapac", default-features = false, features = ["metadata"]} | 72 | stm32-metapac = { version = "0.1.0", path = "../stm32-metapac", default-features = false, features = ["metadata"]} |
| 73 | 73 | ||
| 74 | [features] | 74 | [features] |
| 75 | defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy/defmt", "embedded-io?/defmt", "embassy-usb?/defmt"] | 75 | defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy/defmt", "embassy-embedded-hal/defmt", "embedded-io?/defmt", "embassy-usb?/defmt"] |
| 76 | sdmmc-rs = ["embedded-sdmmc"] | 76 | sdmmc-rs = ["embedded-sdmmc"] |
| 77 | net = ["embassy-net" ] | 77 | net = ["embassy-net" ] |
| 78 | memory-x = ["stm32-metapac/memory-x"] | 78 | memory-x = ["stm32-metapac/memory-x"] |
