From 722e054f5832fd905e4097ffd641242ed461a708 Mon Sep 17 00:00:00 2001 From: marcelbuesing Date: Tue, 5 Jun 2018 23:42:11 +0200 Subject: [PATCH] Actually set provided gas config, closes #3. Failure to set the provided gas config lead to incorrect gas resistance values. --- src/settings.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/settings.rs b/src/settings.rs index de142dc..51317ba 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -213,18 +213,21 @@ impl SettingsBuilder { self.sensor_settings.gas_sett.heatr_temp = Some(heatr_temp); self.sensor_settings.gas_sett.ambient_temperature = ambient_temperature; self.desired_settings |= DesiredSensorSettings::RUN_GAS_SEL; + self.desired_settings |= DesiredSensorSettings::GAS_MEAS_SEL; self } pub fn with_nb_conv(mut self, nb_conv: u8) -> SettingsBuilder { self.sensor_settings.gas_sett.nb_conv = nb_conv; self.desired_settings |= DesiredSensorSettings::NBCONV_SEL; + self.desired_settings |= DesiredSensorSettings::GAS_MEAS_SEL; self } pub fn with_run_gas(mut self, run_gas: bool) -> SettingsBuilder { self.sensor_settings.gas_sett.run_gas_measurement = run_gas; self.desired_settings |= DesiredSensorSettings::RUN_GAS_SEL; + self.desired_settings |= DesiredSensorSettings::GAS_MEAS_SEL; self }