From d4706533850f3d3259d8bf391ad57c60b7cc716a Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 21 Aug 2023 12:55:53 +0800 Subject: [PATCH] Make set_i use get_center again This brings back the ability to override the center point for the current setpoint. --- src/channels.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/channels.rs b/src/channels.rs index 588e994..c2a2900 100644 --- a/src/channels.rs +++ b/src/channels.rs @@ -137,12 +137,7 @@ impl<'a> Channels<'a> { } pub fn set_i(&mut self, channel: usize, i_set: ElectricCurrent) -> ElectricCurrent { - let vref_meas = match channel.into() { - 0 => self.channel0.vref_meas, - 1 => self.channel1.vref_meas, - _ => unreachable!(), - }; - let center_point = vref_meas; + let center_point = self.get_center(channel); let r_sense = ElectricalResistance::new::(R_SENSE); let voltage = i_set * 10.0 * r_sense + center_point; let voltage = self.set_dac(channel, voltage);