Calculate current_abs_max_tec_i from all channels #119

Merged
sb10q merged 1 commits from atse/thermostat:generalise-fan-channel into master 2024-08-07 16:14:29 +08:00
Contributor

Instead of picking channels 0 and 1. Helps to generalise for more than 2 channels.

Instead of picking channels 0 and 1. Helps to generalise for more than 2 channels.
atse added 1 commit 2024-08-06 17:58:04 +08:00
5637c0df62 Calculate current_abs_max_tec_i from all channels
Instead of picking channels 0 and 1. Helps to generalise for more than 2
channels.
esavkin reviewed 2024-08-07 10:22:55 +08:00
@ -566,1 +564,3 @@
|a, b| a.partial_cmp(b).unwrap_or(core::cmp::Ordering::Equal))
(0..CHANNELS)
.map(|channel| self.get_tec_i(channel).abs())
.max_by(|a, b| a.partial_cmp(b).unwrap_or(core::cmp::Ordering::Equal))
Owner

Quite curious though, is it internally same efficiency? I remember in some languages it's not in case of streams

Quite curious though, is it internally same efficiency? I remember in some languages it's not in case of streams
Owner

It doesn't matter here. The bottleneck will be self.get_tec_i(channel) which blocks until the single conversion Adc readings return.

It doesn't matter here. The bottleneck will be `self.get_tec_i(channel)` which blocks until the single conversion Adc readings return.
sb10q merged commit 136c7a0b52 into master 2024-08-07 16:14:29 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/thermostat#119
No description provided.