keep shdn high all the time

This commit is contained in:
Astro 2020-05-20 23:07:03 +02:00
parent d326517453
commit cca0a77657
2 changed files with 3 additions and 3 deletions

View File

@ -28,10 +28,12 @@ pub struct Channel<C: ChannelPins> {
}
impl<C: ChannelPins> Channel<C> {
pub fn new(pins: ChannelPinSet<C>) -> Self {
pub fn new(mut pins: ChannelPinSet<C>) -> Self {
let state = ChannelState::default();
let mut dac = ad5680::Dac::new(pins.dac_spi, pins.dac_sync);
let _ = dac.set(0);
// power up TEC
let _ = pins.shdn.set_high();
// sensible dummy preset. calibrate_i_set() must be used.
let dac_factor = ad5680::MAX_VALUE as f64 / 5.0;

View File

@ -96,12 +96,10 @@ impl Channels {
0 => {
self.channel0.dac.set(value).unwrap();
self.channel0.state.dac_value = voltage;
self.channel0.shdn.set_high().unwrap();
}
1 => {
self.channel1.dac.set(value).unwrap();
self.channel1.state.dac_value = voltage;
self.channel1.shdn.set_high().unwrap();
}
_ => unreachable!(),
}