main: remove special handling for PwmPin::ISet

This commit is contained in:
Astro 2020-09-23 20:50:50 +02:00
parent b9902929a9
commit b394cfa3d4
1 changed files with 12 additions and 15 deletions

View File

@ -303,7 +303,9 @@ fn main() -> ! {
let _ = writeln!(socket, "channel {}: PID enabled to control PWM", channel
);
}
Command::Pwm { channel, pin: PwmPin::ISet, value } => {
Command::Pwm { channel, pin, value } => {
match pin {
PwmPin::ISet => {
channels.channel_state(channel).pid_engaged = false;
leds.g3.off();
let current = ElectricCurrent::new::<ampere>(value);
@ -315,11 +317,6 @@ fn main() -> ! {
max.into_format_args(ampere, Abbreviation),
);
}
Command::Pwm { channel, pin, value } => {
match pin {
PwmPin::ISet =>
// Handled above
unreachable!(),
PwmPin::MaxV => {
let voltage = ElectricPotential::new::<volt>(value);
let (voltage, max) = channels.set_max_v(channel, voltage);