thermostat: rst pid_state at pwr_up

This commit is contained in:
linuswck 2024-07-22 10:53:52 +08:00
parent 8f38acd0f2
commit 3410a271fd
1 changed files with 4 additions and 2 deletions

View File

@ -213,12 +213,14 @@ impl Thermostat {
} }
pub fn power_up(&mut self) { pub fn power_up(&mut self) {
if !self.max1968.is_powered_on() {
self.max1968.power_up(); self.max1968.power_up();
self.pid_ctrl_ch0.reset_pid_state();
}
} }
pub fn power_down(&mut self) { pub fn power_down(&mut self) {
self.max1968.power_down(); self.max1968.power_down();
self.pid_ctrl_ch0.reset_pid_state();
} }
fn set_center_pt(&mut self, value: ElectricPotential) { fn set_center_pt(&mut self, value: ElectricPotential) {