Always set gas sensor settings when setting any gas related setting, regards #3

This commit is contained in:
marcelbuesing 2018-06-06 18:53:24 +02:00
parent 722e054f58
commit 1682f433ab
No known key found for this signature in database
GPG key ID: 03F06F8179D5549D

View file

@ -212,22 +212,19 @@ impl SettingsBuilder {
self.sensor_settings.gas_sett.heatr_dur = Some(heatr_dur); self.sensor_settings.gas_sett.heatr_dur = Some(heatr_dur);
self.sensor_settings.gas_sett.heatr_temp = Some(heatr_temp); self.sensor_settings.gas_sett.heatr_temp = Some(heatr_temp);
self.sensor_settings.gas_sett.ambient_temperature = ambient_temperature; self.sensor_settings.gas_sett.ambient_temperature = ambient_temperature;
self.desired_settings |= DesiredSensorSettings::RUN_GAS_SEL; self.desired_settings |= DesiredSensorSettings::GAS_SENSOR_SEL;
self.desired_settings |= DesiredSensorSettings::GAS_MEAS_SEL;
self self
} }
pub fn with_nb_conv(mut self, nb_conv: u8) -> SettingsBuilder { pub fn with_nb_conv(mut self, nb_conv: u8) -> SettingsBuilder {
self.sensor_settings.gas_sett.nb_conv = nb_conv; self.sensor_settings.gas_sett.nb_conv = nb_conv;
self.desired_settings |= DesiredSensorSettings::NBCONV_SEL; self.desired_settings |= DesiredSensorSettings::GAS_SENSOR_SEL;
self.desired_settings |= DesiredSensorSettings::GAS_MEAS_SEL;
self self
} }
pub fn with_run_gas(mut self, run_gas: bool) -> SettingsBuilder { pub fn with_run_gas(mut self, run_gas: bool) -> SettingsBuilder {
self.sensor_settings.gas_sett.run_gas_measurement = run_gas; self.sensor_settings.gas_sett.run_gas_measurement = run_gas;
self.desired_settings |= DesiredSensorSettings::RUN_GAS_SEL; self.desired_settings |= DesiredSensorSettings::GAS_SENSOR_SEL;
self.desired_settings |= DesiredSensorSettings::GAS_MEAS_SEL;
self self
} }