diff options
| author | Dario Nieuwenhuis <[email protected]> | 2020-11-01 17:17:24 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2020-11-01 17:17:24 +0100 |
| commit | 5e8608c7a5b1e4e92f1fb650ea0ef47e5a6df563 (patch) | |
| tree | f731a0329d92d8fae4168957f8e90716b58ad00b /embassy-nrf/src | |
| parent | 2c13e251849fd3e3cf06e2d5363c311ac880c77d (diff) | |
Make defmt optional with new `anyfmt` crate
Diffstat (limited to 'embassy-nrf/src')
| -rw-r--r-- | embassy-nrf/src/gpiote.rs | 5 | ||||
| -rw-r--r-- | embassy-nrf/src/interrupt.rs | 3 | ||||
| -rw-r--r-- | embassy-nrf/src/uarte.rs | 3 |
3 files changed, 7 insertions, 4 deletions
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 @@ | |||
| 1 | use anyfmt::*; | ||
| 1 | use core::cell::Cell; | 2 | use core::cell::Cell; |
| 2 | use core::ptr; | 3 | use core::ptr; |
| 3 | use defmt::trace; | ||
| 4 | use embassy::util::Signal; | 4 | use embassy::util::Signal; |
| 5 | 5 | ||
| 6 | use crate::hal::gpio::{Input, Level, Output, Pin, Port}; | 6 | use 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))] | ||
| 38 | pub enum NewChannelError { | 39 | pub 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; | |||
| 12 | pub use crate::pac::Interrupt::*; // needed for cortex-m-rt #[interrupt] | 12 | pub use crate::pac::Interrupt::*; // needed for cortex-m-rt #[interrupt] |
| 13 | pub use bare_metal::{CriticalSection, Mutex}; | 13 | pub 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)] |
| 17 | pub enum Priority { | 18 | pub 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}; | |||
| 28 | use embassy::io::{AsyncBufRead, AsyncWrite, Result}; | 28 | use embassy::io::{AsyncBufRead, AsyncWrite, Result}; |
| 29 | use embassy::util::WakerStore; | 29 | use embassy::util::WakerStore; |
| 30 | 30 | ||
| 31 | use defmt::trace; | 31 | use anyfmt::panic; |
| 32 | use anyfmt::*; | ||
| 32 | 33 | ||
| 33 | //use crate::trace; | 34 | //use crate::trace; |
| 34 | 35 | ||
