Add optional serde support for FieldData
This commit is contained in:
parent
4b87e3c2f7
commit
ddaa99c209
2 changed files with 7 additions and 1 deletions
|
@ -16,6 +16,7 @@ maintenance = { status = "passively-maintained" }
|
|||
bitflags = "1.2"
|
||||
embedded-hal = "=1.0.0-alpha.5"
|
||||
log = "0.4"
|
||||
serde = { version = "1.0", optional = true, default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.9"
|
||||
|
|
|
@ -101,6 +101,9 @@ use core::{marker::PhantomData, result};
|
|||
use embedded_hal as hal;
|
||||
use log::{debug, error, info};
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// BME680 General config
|
||||
pub const BME680_POLL_PERIOD_MS: u8 = 10;
|
||||
|
||||
|
@ -299,6 +302,8 @@ impl Clone for CalibData {
|
|||
|
||||
/// Contains read sensors values e.g. temperature, pressure, humidity etc.
|
||||
#[derive(Debug, Default, Copy)]
|
||||
#[cfg(feature = "serde")]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct FieldData {
|
||||
/// Contains new_data, gasm_valid & heat_stab
|
||||
|
|
Loading…
Reference in a new issue