aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2020-11-01 17:17:24 +0100
committerDario Nieuwenhuis <[email protected]>2020-11-01 17:17:24 +0100
commit5e8608c7a5b1e4e92f1fb650ea0ef47e5a6df563 (patch)
treef731a0329d92d8fae4168957f8e90716b58ad00b /embassy-nrf
parent2c13e251849fd3e3cf06e2d5363c311ac880c77d (diff)
Make defmt optional with new `anyfmt` crate
Diffstat (limited to 'embassy-nrf')
-rw-r--r--embassy-nrf/Cargo.toml18
-rw-r--r--embassy-nrf/src/gpiote.rs5
-rw-r--r--embassy-nrf/src/interrupt.rs3
-rw-r--r--embassy-nrf/src/uarte.rs3
4 files changed, 17 insertions, 12 deletions
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml
index 0019cbfb9..6cf23aa79 100644
--- a/embassy-nrf/Cargo.toml
+++ b/embassy-nrf/Cargo.toml
@@ -5,12 +5,11 @@ authors = ["Dario Nieuwenhuis <[email protected]>"]
5edition = "2018" 5edition = "2018"
6 6
7[features] 7[features]
8defmt-default = [] 8defmt-trace = [ ]
9defmt-trace = [] 9defmt-debug = [ ]
10defmt-debug = [] 10defmt-info = [ ]
11defmt-info = [] 11defmt-warn = [ ]
12defmt-warn = [] 12defmt-error = [ ]
13defmt-error = []
14 13
1552810 = ["nrf52810-pac", "nrf52810-hal"] 1452810 = ["nrf52810-pac", "nrf52810-hal"]
1652811 = ["nrf52811-pac"] #, "nrf52811-hal"] 1552811 = ["nrf52811-pac"] #, "nrf52811-hal"]
@@ -21,14 +20,17 @@ defmt-error = []
21 20
22[dependencies] 21[dependencies]
23embassy = { version = "0.1.0", path = "../embassy" } 22embassy = { version = "0.1.0", path = "../embassy" }
23
24anyfmt = { version = "0.1.0", path = "../anyfmt" }
25defmt = { version = "0.1.0", optional = true }
26
24cortex-m-rt = "0.6.12" 27cortex-m-rt = "0.6.12"
25cortex-m = { version = "0.6.3" } 28cortex-m = { version = "0.6.3" }
26embedded-hal = { version = "0.2.4" } 29embedded-hal = { version = "0.2.4" }
27bare-metal = { version = "0.2.0", features = ["const-fn"] } 30bare-metal = { version = "0.2.0", features = ["const-fn"] }
28defmt = "0.1.0"
29 31
30nrf52810-pac = { version = "0.9.0", optional = true } 32nrf52810-pac = { version = "0.9.0", optional = true }
31nrf52811-pac = { version = "0.9.0", optional = true } 33nrf52811-pac = { version = "0.9.1", optional = true }
32nrf52832-pac = { version = "0.9.0", optional = true } 34nrf52832-pac = { version = "0.9.0", optional = true }
33nrf52833-pac = { version = "0.9.0", optional = true } 35nrf52833-pac = { version = "0.9.0", optional = true }
34nrf52840-pac = { version = "0.9.0", optional = true } 36nrf52840-pac = { version = "0.9.0", optional = true }
diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs
index 0b9a33b3a..c18db2626 100644
--- a/embassy-nrf/src/gpiote.rs
+++ b/embassy-nrf/src/gpiote.rs
@@ -1,6 +1,6 @@
1use anyfmt::*;
1use core::cell::Cell; 2use core::cell::Cell;
2use core::ptr; 3use core::ptr;
3use defmt::trace;
4use embassy::util::Signal; 4use embassy::util::Signal;
5 5
6use crate::hal::gpio::{Input, Level, Output, Pin, Port}; 6use crate::hal::gpio::{Input, Level, Output, Pin, Port};
@@ -34,7 +34,8 @@ pub enum TaskOutPolarity {
34 Toggle, 34 Toggle,
35} 35}
36 36
37#[derive(defmt::Format)] 37#[derive(Debug, Copy, Clone, Eq, PartialEq)]
38#[cfg_attr(feature = "defmt", derive(defmt::Format))]
38pub enum NewChannelError { 39pub enum NewChannelError {
39 NoFreeChannels, 40 NoFreeChannels,
40} 41}
diff --git a/embassy-nrf/src/interrupt.rs b/embassy-nrf/src/interrupt.rs
index 581adff74..8918b13ee 100644
--- a/embassy-nrf/src/interrupt.rs
+++ b/embassy-nrf/src/interrupt.rs
@@ -12,7 +12,8 @@ pub use crate::pac::Interrupt;
12pub use crate::pac::Interrupt::*; // needed for cortex-m-rt #[interrupt] 12pub use crate::pac::Interrupt::*; // needed for cortex-m-rt #[interrupt]
13pub use bare_metal::{CriticalSection, Mutex}; 13pub use bare_metal::{CriticalSection, Mutex};
14 14
15#[derive(defmt::Format, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16#[cfg_attr(feature = "defmt", derive(defmt::Format))]
16#[repr(u8)] 17#[repr(u8)]
17pub enum Priority { 18pub enum Priority {
18 Level0 = 0, 19 Level0 = 0,
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs
index 575405b57..13b06397d 100644
--- a/embassy-nrf/src/uarte.rs
+++ b/embassy-nrf/src/uarte.rs
@@ -28,7 +28,8 @@ pub use uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity};
28use embassy::io::{AsyncBufRead, AsyncWrite, Result}; 28use embassy::io::{AsyncBufRead, AsyncWrite, Result};
29use embassy::util::WakerStore; 29use embassy::util::WakerStore;
30 30
31use defmt::trace; 31use anyfmt::panic;
32use anyfmt::*;
32 33
33//use crate::trace; 34//use crate::trace;
34 35