forked from M-Labs/thermostat
Account for swapped current limits
This commit is contained in:
parent
ce4fb6090a
commit
2dd01f8a15
@ -204,13 +204,21 @@ impl Handler {
|
||||
}
|
||||
PwmPin::MaxIPos => {
|
||||
let current = ElectricCurrent::new::<ampere>(value);
|
||||
if channels.channel_state(channel).polarity_swapped {
|
||||
channels.set_max_i_neg(channel, current);
|
||||
} else {
|
||||
channels.set_max_i_pos(channel, current);
|
||||
}
|
||||
}
|
||||
PwmPin::MaxINeg => {
|
||||
let current = ElectricCurrent::new::<ampere>(value);
|
||||
if channels.channel_state(channel).polarity_swapped {
|
||||
channels.set_max_i_pos(channel, current);
|
||||
} else {
|
||||
channels.set_max_i_neg(channel, current);
|
||||
}
|
||||
}
|
||||
}
|
||||
send_line(socket, b"{}");
|
||||
Ok(Handler::Handled)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user