diff --git a/src/thermostat/thermostat.rs b/src/thermostat/thermostat.rs index 58cd346..bc222b5 100644 --- a/src/thermostat/thermostat.rs +++ b/src/thermostat/thermostat.rs @@ -213,12 +213,14 @@ impl Thermostat { } pub fn power_up(&mut self) { - self.max1968.power_up(); + if !self.max1968.is_powered_on() { + self.max1968.power_up(); + self.pid_ctrl_ch0.reset_pid_state(); + } } pub fn power_down(&mut self) { self.max1968.power_down(); - self.pid_ctrl_ch0.reset_pid_state(); } fn set_center_pt(&mut self, value: ElectricPotential) {