forked from M-Labs/kirdy
ld_ctrl: set_dac() fn now returns the volt set
- before this fix, set_dac() just returns the inputted voltage
This commit is contained in:
parent
5f83b73011
commit
8139ebdc1b
@ -81,7 +81,7 @@ impl LdCtrl {
|
|||||||
let value = ((voltage / dac_out_v_max).get::<ratio>()
|
let value = ((voltage / dac_out_v_max).get::<ratio>()
|
||||||
* (max5719::MAX_VALUE as f64)) as u32;
|
* (max5719::MAX_VALUE as f64)) as u32;
|
||||||
self.phy.dac.set(value).unwrap();
|
self.phy.dac.set(value).unwrap();
|
||||||
voltage
|
value as f64 * dac_out_v_max / max5719::MAX_VALUE as f64
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_i(&mut self, current: ElectricCurrent, transimpedance: TransimpedanceUnit, dac_out_v_max: ElectricPotential) -> ElectricCurrent {
|
pub fn set_i(&mut self, current: ElectricCurrent, transimpedance: TransimpedanceUnit, dac_out_v_max: ElectricPotential) -> ElectricCurrent {
|
||||||
|
Loading…
Reference in New Issue
Block a user