1
0
forked from M-Labs/kirdy

thermostat: Limit Pid Temp SetPt to TempMon limits

This commit is contained in:
linuswck 2024-02-21 17:37:56 +08:00
parent a8787430b1
commit 6ee45b4814

View File

@ -345,6 +345,8 @@ impl Thermostat{
} }
pub fn set_temperature_setpoint(&mut self, t: ThermodynamicTemperature) { pub fn set_temperature_setpoint(&mut self, t: ThermodynamicTemperature) {
let temp_mon_settings = self.temp_mon.get_settings();
let t = t.min(temp_mon_settings.upper_limit).max(temp_mon_settings.lower_limit);
self.pid_ctrl_ch0.set_pid_setpoint(t); self.pid_ctrl_ch0.set_pid_setpoint(t);
self.temp_mon.set_setpoint(t); self.temp_mon.set_setpoint(t);
} }