From cca0a77657161ccad5b9afdd22eda87438bd6c67 Mon Sep 17 00:00:00 2001 From: Astro Date: Wed, 20 May 2020 23:07:03 +0200 Subject: [PATCH] keep shdn high all the time --- src/channel.rs | 4 +++- src/channels.rs | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/channel.rs b/src/channel.rs index fb4022c..7980e95 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -28,10 +28,12 @@ pub struct Channel { } impl Channel { - pub fn new(pins: ChannelPinSet) -> Self { + pub fn new(mut pins: ChannelPinSet) -> 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; diff --git a/src/channels.rs b/src/channels.rs index 041904a..ea58cc4 100644 --- a/src/channels.rs +++ b/src/channels.rs @@ -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!(), }