From 654964831ada962abbffc1d7824dc9d5ef4c32e1 Mon Sep 17 00:00:00 2001 From: linuswck Date: Tue, 9 Jan 2024 17:03:06 +0800 Subject: [PATCH] boot: Change thermostat boot seq for new setup seq - Power Up -> Calibrate -> Set the TEC current to some value --- src/device/boot.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/device/boot.rs b/src/device/boot.rs index 2d2c158..d48e41e 100644 --- a/src/device/boot.rs +++ b/src/device/boot.rs @@ -73,8 +73,10 @@ pub fn bootup( let mut thermostat = Thermostat::new(tec_driver); thermostat.setup(); - thermostat.set_i(ElectricCurrent::new::(1.0)); + thermostat.power_up(); + thermostat.calibrate_dac_value(); + thermostat.set_i(ElectricCurrent::new::(1.0)); let mut wd = IndependentWatchdog::new(perif.IWDG); wd.start(WATCHDOG_PERIOD.millis());