Make set_i use get_center again

This brings back the ability to override the center point for the
current setpoint.
This commit is contained in:
atse 2023-08-21 12:55:53 +08:00
parent 70d20f3deb
commit d470653385

View File

@ -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::<ohm>(R_SENSE);
let voltage = i_set * 10.0 * r_sense + center_point;
let voltage = self.set_dac(channel, voltage);