forked from M-Labs/thermostat
fan: Avoid reading tec_i every cycle pre v3.0
This is the last remaining tec_i read, involving vref.
This commit is contained in:
parent
76547be90a
commit
40fee0d51c
@ -525,9 +525,15 @@ impl<'a> Channels<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn current_abs_max_tec_i(&mut self) -> ElectricCurrent {
|
pub fn current_abs_max_tec_i(&mut self) -> ElectricCurrent {
|
||||||
|
if self.hwrev.major > 2 {
|
||||||
max_by(self.get_tec_i(0).abs(),
|
max_by(self.get_tec_i(0).abs(),
|
||||||
self.get_tec_i(1).abs(),
|
self.get_tec_i(1).abs(),
|
||||||
|a, b| a.partial_cmp(b).unwrap_or(core::cmp::Ordering::Equal))
|
|a, b| a.partial_cmp(b).unwrap_or(core::cmp::Ordering::Equal))
|
||||||
|
} else {
|
||||||
|
max_by(self.get_i(0).abs(),
|
||||||
|
self.get_i(1).abs(),
|
||||||
|
|a, b| a.partial_cmp(b).unwrap_or(core::cmp::Ordering::Equal))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user