forked from M-Labs/thermostat
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:
parent
70d20f3deb
commit
d470653385
@ -137,12 +137,7 @@ impl<'a> Channels<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_i(&mut self, channel: usize, i_set: ElectricCurrent) -> ElectricCurrent {
|
pub fn set_i(&mut self, channel: usize, i_set: ElectricCurrent) -> ElectricCurrent {
|
||||||
let vref_meas = match channel.into() {
|
let center_point = self.get_center(channel);
|
||||||
0 => self.channel0.vref_meas,
|
|
||||||
1 => self.channel1.vref_meas,
|
|
||||||
_ => unreachable!(),
|
|
||||||
};
|
|
||||||
let center_point = vref_meas;
|
|
||||||
let r_sense = ElectricalResistance::new::<ohm>(R_SENSE);
|
let r_sense = ElectricalResistance::new::<ohm>(R_SENSE);
|
||||||
let voltage = i_set * 10.0 * r_sense + center_point;
|
let voltage = i_set * 10.0 * r_sense + center_point;
|
||||||
let voltage = self.set_dac(channel, voltage);
|
let voltage = self.set_dac(channel, voltage);
|
||||||
|
Loading…
Reference in New Issue
Block a user