diff --git a/Cargo.toml b/Cargo.toml index c0a29c8..3b6e3dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,12 +12,12 @@ edition = "2021" maintenance = { status = "passively-maintained" } [dependencies] -bitflags = "1.3.2" +bitflags = "2.6" embedded-hal = "=1.0.0" log = "0.4" serde = { version = "1.0", optional = true, default-features = false, features = ["derive"] } linux-embedded-hal = "0.4.0" -anyhow = { version = "1.0.80" , default-features = false} +anyhow = { version = "1.0" , default-features = false} [dev-dependencies] env_logger = "0.11.5" diff --git a/examples/read_sensor_data.rs b/examples/read_sensor_data.rs index dfa9243..4c6097b 100644 --- a/examples/read_sensor_data.rs +++ b/examples/read_sensor_data.rs @@ -30,7 +30,7 @@ fn main() -> Result<(), anyhow::Error> { let profile_dur = dev.get_profile_duration(&settings.0)?; info!("Profile duration {:?}", profile_dur); info!("Setting sensor settings"); - dev.set_sensor_settings(&mut delayer, settings)?; + dev.set_sensor_settings(&mut delayer, &settings)?; info!("Setting forced power modes"); dev.set_sensor_mode(&mut delayer, PowerMode::ForcedMode)?; diff --git a/src/lib.rs b/src/lib.rs index c5f0ffa..ff0a5a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -360,7 +360,7 @@ where pub fn set_sensor_settings( &mut self, delay: &mut D, - settings: Settings, + settings: &Settings, ) -> Result<(), anyhow::Error> { let (sensor_settings, desired_settings) = settings; let tph_sett = sensor_settings.temperature_settings; diff --git a/src/settings.rs b/src/settings.rs index 56cff0d..0bfa31f 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -140,7 +140,7 @@ bitflags! { /// To set NB conversion setting. const NBCONV_SEL = 128; /// To set all gas sensor related settings - const GAS_SENSOR_SEL = Self::GAS_MEAS_SEL.bits | Self::RUN_GAS_SEL.bits | Self::NBCONV_SEL.bits; + const GAS_SENSOR_SEL = Self::GAS_MEAS_SEL.bits() | Self::RUN_GAS_SEL.bits() | Self::NBCONV_SEL.bits(); } }