From 438eede6587ffb9327060f3440393c970cd0aefb Mon Sep 17 00:00:00 2001 From: Rick Altherr Date: Thu, 3 Nov 2022 13:48:52 -0700 Subject: [PATCH] thermal: fix another case of subtraction in the wrong order --- task/thermal/src/control.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/task/thermal/src/control.rs b/task/thermal/src/control.rs index 855634df0..ddedc1e19 100644 --- a/task/thermal/src/control.rs +++ b/task/thermal/src/control.rs @@ -680,7 +680,7 @@ impl<'a> ThermalControl<'a> { for (v, i) in values.iter().zip(self.bsp.inputs.iter()) { if let TemperatureReading::Valid { value, time_ms } = v { let temperature = value.0 - + (time_ms - now_ms) as f32 / 1000.0 + + (now_ms - time_ms) as f32 / 1000.0 * i.temps.temperature_slew_deg_per_sec; any_power_down |= temperature >= i.temps.power_down_temperature.0;