Make defmt optional with new anyfmt
crate
This commit is contained in:
@ -5,12 +5,11 @@ authors = ["Dario Nieuwenhuis <dirbaio@dirbaio.net>"]
|
||||
edition = "2018"
|
||||
|
||||
[features]
|
||||
defmt-default = []
|
||||
defmt-trace = []
|
||||
defmt-debug = []
|
||||
defmt-info = []
|
||||
defmt-warn = []
|
||||
defmt-error = []
|
||||
defmt-trace = [ ]
|
||||
defmt-debug = [ ]
|
||||
defmt-info = [ ]
|
||||
defmt-warn = [ ]
|
||||
defmt-error = [ ]
|
||||
|
||||
52810 = ["nrf52810-pac", "nrf52810-hal"]
|
||||
52811 = ["nrf52811-pac"] #, "nrf52811-hal"]
|
||||
@ -21,14 +20,17 @@ defmt-error = []
|
||||
|
||||
[dependencies]
|
||||
embassy = { version = "0.1.0", path = "../embassy" }
|
||||
|
||||
anyfmt = { version = "0.1.0", path = "../anyfmt" }
|
||||
defmt = { version = "0.1.0", optional = true }
|
||||
|
||||
cortex-m-rt = "0.6.12"
|
||||
cortex-m = { version = "0.6.3" }
|
||||
embedded-hal = { version = "0.2.4" }
|
||||
bare-metal = { version = "0.2.0", features = ["const-fn"] }
|
||||
defmt = "0.1.0"
|
||||
|
||||
nrf52810-pac = { version = "0.9.0", optional = true }
|
||||
nrf52811-pac = { version = "0.9.0", optional = true }
|
||||
nrf52811-pac = { version = "0.9.1", optional = true }
|
||||
nrf52832-pac = { version = "0.9.0", optional = true }
|
||||
nrf52833-pac = { version = "0.9.0", optional = true }
|
||||
nrf52840-pac = { version = "0.9.0", optional = true }
|
||||
|
@ -1,6 +1,6 @@
|
||||
use anyfmt::*;
|
||||
use core::cell::Cell;
|
||||
use core::ptr;
|
||||
use defmt::trace;
|
||||
use embassy::util::Signal;
|
||||
|
||||
use crate::hal::gpio::{Input, Level, Output, Pin, Port};
|
||||
@ -34,7 +34,8 @@ pub enum TaskOutPolarity {
|
||||
Toggle,
|
||||
}
|
||||
|
||||
#[derive(defmt::Format)]
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
pub enum NewChannelError {
|
||||
NoFreeChannels,
|
||||
}
|
||||
|
@ -12,7 +12,8 @@ pub use crate::pac::Interrupt;
|
||||
pub use crate::pac::Interrupt::*; // needed for cortex-m-rt #[interrupt]
|
||||
pub use bare_metal::{CriticalSection, Mutex};
|
||||
|
||||
#[derive(defmt::Format, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
#[repr(u8)]
|
||||
pub enum Priority {
|
||||
Level0 = 0,
|
||||
|
@ -28,7 +28,8 @@ pub use uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity};
|
||||
use embassy::io::{AsyncBufRead, AsyncWrite, Result};
|
||||
use embassy::util::WakerStore;
|
||||
|
||||
use defmt::trace;
|
||||
use anyfmt::panic;
|
||||
use anyfmt::*;
|
||||
|
||||
//use crate::trace;
|
||||
|
||||
|
Reference in New Issue
Block a user