summaryrefslogtreecommitdiffstats
path: root/src/devices/common.rs
diff options
context:
space:
mode:
authorMarkus Reiter <me@reitermark.us>2024-01-12 20:24:51 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2024-01-19 11:23:31 +0100
commitb3ca672f70c71194da40a7670549a8264c13d971 (patch)
tree1f316806351a059ca5b5fccbcf4d790b94c0b471 /src/devices/common.rs
parented4cc1dbc5b048332b68a0ebc1d7113d482a74a2 (diff)
downloadads1x1x-async-b3ca672f70c71194da40a7670549a8264c13d971.tar.gz
ads1x1x-async-b3ca672f70c71194da40a7670549a8264c13d971.tar.xz
ads1x1x-async-b3ca672f70c71194da40a7670549a8264c13d971.zip
Update to `embedded-hal` 1.0.
Diffstat (limited to 'src/devices/common.rs')
-rw-r--r--src/devices/common.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/devices/common.rs b/src/devices/common.rs
index 2234d93..f1509d3 100644
--- a/src/devices/common.rs
+++ b/src/devices/common.rs
@@ -7,11 +7,10 @@ where
DI: interface::WriteData<Error = E> + interface::ReadData<Error = E>,
{
pub(super) fn set_operating_mode(&mut self, mode: OperatingMode) -> Result<(), Error<E>> {
- let config;
- match mode {
- OperatingMode::OneShot => config = self.config.with_high(BitFlags::OP_MODE),
- OperatingMode::Continuous => config = self.config.with_low(BitFlags::OP_MODE),
- }
+ let config = match mode {
+ OperatingMode::OneShot => self.config.with_high(BitFlags::OP_MODE),
+ OperatingMode::Continuous => self.config.with_low(BitFlags::OP_MODE),
+ };
self.iface.write_register(Register::CONFIG, config.bits)?;
self.config = config;
Ok(())