diff --git a/src/thermostat/thermostat.rs b/src/thermostat/thermostat.rs index ef9c095..45894de 100644 --- a/src/thermostat/thermostat.rs +++ b/src/thermostat/thermostat.rs @@ -32,11 +32,10 @@ pub struct TecSettings { } impl TecSettings{ - // FixMe: Rev0_2 is 3.3V max while Rev0_3 is 3.0V max pub const DAC_OUT_V_MAX: ElectricPotential = ElectricPotential { dimension: PhantomData, units: PhantomData, - value: 3.3, + value: 3.0, }; pub const TEC_VSEC_BIAS_V: ElectricPotential = ElectricPotential { dimension: PhantomData, @@ -214,9 +213,7 @@ impl Thermostat{ } pub fn get_tec_v(&mut self) -> ElectricPotential { - // Fixme: Rev0_2 has Analog Input Polarity Reversed - // Remove the -ve sign for Rev0_3 - -(self.max1968.adc_read(AdcReadTarget::VTec, 16) - TecSettings::TEC_VSEC_BIAS_V) * 4.0 + (self.max1968.adc_read(AdcReadTarget::VTec, 16) - TecSettings::TEC_VSEC_BIAS_V) * 4.0 } /// Calibrates the DAC output to match vref of the MAX driver to reduce zero-current offset of the MAX driver output.