Skip to content

Commit

Permalink
feat: serde features and derive for SensorData
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Dec 27, 2023
1 parent 4497a11 commit f65cda6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ default = []

nightly = ["dep:embedded-hal-async"]
defmt-03 = ["dep:defmt"]
serde = ["dep:serde"]

[dependencies]
embedded-hal = "0.2"
embedded-hal-async = { version = "1.0.0-rc.3", optional = true }

defmt = { version = "0.3", optional = true }
serde = { version = "1", default-features = false, features = ["derive"], optional = true }

num-traits = { version = "0.2", default-features = false, features = ["libm"] }
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ pub enum OutputMode {

#[derive(Debug, Copy, Clone)]
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
///Sensor data
pub struct SensorData {
///The measured pressure
Expand Down

0 comments on commit f65cda6

Please sign in to comment.