diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-30 13:36:06 +0200 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-31 13:41:26 +0200 |
commit | 50223ad02e2f487540107e320c8bef40a9849582 (patch) | |
tree | 58b4e44e2261940d07aba96b8d8e83457e641f53 /src/devices/features/tier2.rs | |
parent | ab1221e175f2da577c7a3fb510b5ae5cf41b0697 (diff) | |
download | ads1x1x-async-50223ad02e2f487540107e320c8bef40a9849582.tar.gz ads1x1x-async-50223ad02e2f487540107e320c8bef40a9849582.tar.xz ads1x1x-async-50223ad02e2f487540107e320c8bef40a9849582.zip |
Format code
Diffstat (limited to 'src/devices/features/tier2.rs')
-rw-r--r-- | src/devices/features/tier2.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/devices/features/tier2.rs b/src/devices/features/tier2.rs index 48e4eb9..0b0b92c 100644 --- a/src/devices/features/tier2.rs +++ b/src/devices/features/tier2.rs @@ -128,7 +128,10 @@ where /// The comparator can be enabled by setting the comparator queue. /// See [`set_comparator_queue()`](struct.Ads1x1x.html#method.set_comparator_queue) pub fn disable_comparator(&mut self) -> Result<(), Error<E>> { - let config = self.config.with_high(BF::COMP_QUE1).with_high(BF::COMP_QUE0); + let config = self + .config + .with_high(BF::COMP_QUE1) + .with_high(BF::COMP_QUE0); self.iface.write_register(Register::CONFIG, config.bits)?; self.config = config; Ok(()) @@ -142,7 +145,12 @@ where /// /// When calling this the comparator will be disabled and the thresholds will be cleared. pub fn use_alert_rdy_pin_as_ready(&mut self) -> Result<(), Error<E>> { - if self.config != self.config.with_high(BF::COMP_QUE1).with_high(BF::COMP_QUE0) { + if self.config + != self + .config + .with_high(BF::COMP_QUE1) + .with_high(BF::COMP_QUE0) + { self.disable_comparator()?; } self.iface.write_register(Register::HIGH_TH, 0x8000)?; |