From 4497a115837e3cb21553c32495f4a1d14dc716cd Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Wed, 27 Dec 2023 12:07:01 +0200 Subject: [PATCH] feat: add defmt-03 feature with Format for SensorData Signed-off-by: Lachezar Lechev --- Cargo.toml | 5 ++++- src/lib.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2172a65..709ec83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,10 +16,13 @@ rust-version = "1.62" [features] default = [] -nightly = ["embedded-hal-async"] +nightly = ["dep:embedded-hal-async"] +defmt-03 = ["dep:defmt"] [dependencies] embedded-hal = "0.2" embedded-hal-async = { version = "1.0.0-rc.3", optional = true } +defmt = { version = "0.3", optional = true } + num-traits = { version = "0.2", default-features = false, features = ["libm"] } \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 817ba6d..3942455 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -529,6 +529,7 @@ pub enum OutputMode { } #[derive(Debug, Copy, Clone)] +#[cfg_attr(feature = "defmt-03", derive(defmt::Format))] ///Sensor data pub struct SensorData { ///The measured pressure