From b3ca672f70c71194da40a7670549a8264c13d971 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 12 Jan 2024 20:24:51 +0100 Subject: Update to `embedded-hal` 1.0. --- src/devices/mode/continuous.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/devices/mode/continuous.rs') diff --git a/src/devices/mode/continuous.rs b/src/devices/mode/continuous.rs index 64aa179..b3b4807 100644 --- a/src/devices/mode/continuous.rs +++ b/src/devices/mode/continuous.rs @@ -1,11 +1,10 @@ //! Continuous measurement mode use crate::{ - channels::ChannelSelection, conversion, devices::OperatingMode, interface, mode, Ads1x1x, - Error, ModeChangeError, Register, + conversion, devices::OperatingMode, interface, mode, Ads1x1x, ChannelId, Error, + ModeChangeError, Register, }; use core::marker::PhantomData; -use embedded_hal::adc; impl Ads1x1x where @@ -41,11 +40,9 @@ where /// Note that when changing the channel in continuous conversion mode, the /// ongoing conversion will be completed. /// The following conversions will use the new channel configuration. - pub fn select_channel(&mut self, _channel: &mut CH) -> Result<(), Error> - where - CH: adc::Channel, ID = ChannelSelection>, - { - let config = self.config.with_mux_bits(CH::channel()); + #[allow(unused_variables)] + pub fn select_channel>(&mut self, channel: CH) -> Result<(), Error> { + let config = self.config.with_mux_bits(CH::channel_id()); self.iface.write_register(Register::CONFIG, config.bits)?; self.config = config; Ok(()) -- cgit v1.2.3-54-g00ecf