Make defmt optional with new anyfmt crate

This commit is contained in:
Dario Nieuwenhuis
2020-11-01 17:17:24 +01:00
parent 2c13e25184
commit 5e8608c7a5
29 changed files with 267 additions and 233 deletions

View File

@ -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,
}

View File

@ -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,

View File

@ -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;