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"
|
bitflags = "1.2"
|
||||||
embedded-hal = "=1.0.0-alpha.5"
|
embedded-hal = "=1.0.0-alpha.5"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
serde = { version = "1.0", optional = true, default-features = false }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
|
|
|
@ -101,6 +101,9 @@ use core::{marker::PhantomData, result};
|
||||||
use embedded_hal as hal;
|
use embedded_hal as hal;
|
||||||
use log::{debug, error, info};
|
use log::{debug, error, info};
|
||||||
|
|
||||||
|
#[cfg(feature = "serde")]
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// BME680 General config
|
/// BME680 General config
|
||||||
pub const BME680_POLL_PERIOD_MS: u8 = 10;
|
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.
|
/// Contains read sensors values e.g. temperature, pressure, humidity etc.
|
||||||
#[derive(Debug, Default, Copy)]
|
#[derive(Debug, Default, Copy)]
|
||||||
|
#[cfg(feature = "serde")]
|
||||||
|
#[derive(Serialize, Deserialize)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct FieldData {
|
pub struct FieldData {
|
||||||
/// Contains new_data, gasm_valid & heat_stab
|
/// Contains new_data, gasm_valid & heat_stab
|
||||||
|
|
Loading…
Reference in a new issue