summaryrefslogtreecommitdiffstats
path: root/src/devices/mode/oneshot.rs
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-21 09:35:37 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-21 09:35:37 +0100
commit5485d9655e2ab3a6d04e5f69b246f5db4d2c5936 (patch)
tree84bb1e825656d4c523b65edc5d7780fbb060c8cc /src/devices/mode/oneshot.rs
parente4a1ac5a04d021ef026c559354e9913ae59864d8 (diff)
downloadads1x1x-async-5485d9655e2ab3a6d04e5f69b246f5db4d2c5936.tar.gz
ads1x1x-async-5485d9655e2ab3a6d04e5f69b246f5db4d2c5936.tar.xz
ads1x1x-async-5485d9655e2ab3a6d04e5f69b246f5db4d2c5936.zip
Code formatting
Diffstat (limited to 'src/devices/mode/oneshot.rs')
-rw-r--r--src/devices/mode/oneshot.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/devices/mode/oneshot.rs b/src/devices/mode/oneshot.rs
index a03d8d2..3595c26 100644
--- a/src/devices/mode/oneshot.rs
+++ b/src/devices/mode/oneshot.rs
@@ -1,14 +1,14 @@
//! Common functions
-use core::marker::PhantomData;
-use { Ads1x1x, mode, Error, Register, BitFlags, Config };
-use { interface, conversion, hal, nb };
use channels::ChannelSelection;
+use core::marker::PhantomData;
+use {conversion, hal, interface, nb};
+use {mode, Ads1x1x, BitFlags, Config, Error, Register};
impl<DI, IC, CONV, E> Ads1x1x<DI, IC, CONV, mode::OneShot>
where
DI: interface::WriteData<Error = E> + interface::ReadData<Error = E>,
- CONV: conversion::ConvertMeasurement
+ CONV: conversion::ConvertMeasurement,
{
/// Change operating mode to Continuous
pub fn into_continuous(self) -> Result<Ads1x1x<DI, IC, CONV, mode::Continuous>, Error<E>> {
@@ -19,7 +19,7 @@ where
a_conversion_was_started: self.a_conversion_was_started,
_conv: PhantomData,
_ic: PhantomData,
- _mode: PhantomData
+ _mode: PhantomData,
})
}
@@ -34,7 +34,7 @@ impl<DI, IC, CONV, E, CH> hal::adc::OneShot<Ads1x1x<DI, IC, CONV, mode::OneShot>
where
DI: interface::ReadData<Error = E> + interface::WriteData<Error = E>,
CONV: conversion::ConvertMeasurement,
- CH: hal::adc::Channel<Ads1x1x<DI, IC, CONV, mode::OneShot>, ID = ChannelSelection>
+ CH: hal::adc::Channel<Ads1x1x<DI, IC, CONV, mode::OneShot>, ID = ChannelSelection>,
{
type Error = Error<E>;
@@ -63,7 +63,8 @@ where
return Ok(CONV::convert_measurement(value));
}
let config = self.config.with_mux_bits(CH::channel());
- self.trigger_measurement(&config).map_err(nb::Error::Other)?;
+ self.trigger_measurement(&config)
+ .map_err(nb::Error::Other)?;
self.config = config;
self.a_conversion_was_started = true;
Err(nb::Error::WouldBlock)