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:
linuswck 2024-02-20 12:30:00 +08:00
parent 5f83b73011
commit 8139ebdc1b

View File

@ -81,7 +81,7 @@ impl LdCtrl {
let value = ((voltage / dac_out_v_max).get::<ratio>()
* (max5719::MAX_VALUE as f64)) as u32;
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 {