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 e702e01344
commit c06d89eca1
1 changed files with 1 additions and 6 deletions

View File

@ -140,12 +140,7 @@ impl<'a> Channels<'a> {
}
pub fn set_i(&mut self, channel: usize, i_tec: 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_tec * 10.0 * r_sense + center_point;
let voltage = self.set_dac(channel, voltage);