Compare commits
1 Commits
add5120f8c
...
b04a61c414
Author | SHA1 | Date |
---|---|---|
atse | b04a61c414 |
|
@ -475,6 +475,15 @@ impl Channels {
|
|||
serde_json_core::to_vec(&summaries)
|
||||
}
|
||||
|
||||
pub fn pid_engaged(&mut self) -> bool {
|
||||
for channel in 0..CHANNELS {
|
||||
if self.channel_state(channel).pid_engaged {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
fn pwm_summary(&mut self, channel: usize) -> PwmSummary {
|
||||
PwmSummary {
|
||||
channel,
|
||||
|
|
|
@ -188,7 +188,7 @@ impl Handler {
|
|||
PwmPin::ISet => {
|
||||
channels.channel_state(channel).pid_engaged = false;
|
||||
// Only turn off LED when PID is disengaged on all channels
|
||||
if !channels.channel_state(channel ^ 1).pid_engaged {
|
||||
if !channels.pid_engaged() {
|
||||
leds.g3.off();
|
||||
}
|
||||
let current = ElectricCurrent::new::<ampere>(value);
|
||||
|
|
Loading…
Reference in New Issue