mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
Fixed mistakes.
This commit is contained in:
parent
354ff3bac3
commit
874dbec5a4
@ -351,10 +351,14 @@ impl<'d> Pwm<'d> {
|
|||||||
|
|
||||||
let pwm_output_a = if let Some(pin_a) = self.pin_a {
|
let pwm_output_a = if let Some(pin_a) = self.pin_a {
|
||||||
Some(PwmOutput::new(PwmChannelPin::A(pin_a), self.slice.clone()))
|
Some(PwmOutput::new(PwmChannelPin::A(pin_a), self.slice.clone()))
|
||||||
|
}else{
|
||||||
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
let pwm_output_b = if let Some(pin_b) = self.pin_b {
|
let pwm_output_b = if let Some(pin_b) = self.pin_b {
|
||||||
Some(PwmOutput::new(PwmChannelPin::B(pin_b), self.slice.clone()))
|
Some(PwmOutput::new(PwmChannelPin::B(pin_b), self.slice.clone()))
|
||||||
|
}else {
|
||||||
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
(pwm_output_a,pwm_output_b)
|
(pwm_output_a,pwm_output_b)
|
||||||
@ -397,12 +401,12 @@ impl<'d> SetDutyCycle for PwmOutput<'d> {
|
|||||||
|
|
||||||
let p = pac::PWM.ch(self.slice);
|
let p = pac::PWM.ch(self.slice);
|
||||||
match self.channel_pin {
|
match self.channel_pin {
|
||||||
PwmChannelPin::A => {
|
PwmChannelPin::A(_) => {
|
||||||
p.cc().modify(|w| {
|
p.cc().modify(|w| {
|
||||||
w.set_a(duty);
|
w.set_a(duty);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
PwmChannelPin::B => {
|
PwmChannelPin::B(_) => {
|
||||||
p.cc().modify(|w| {
|
p.cc().modify(|w| {
|
||||||
w.set_b(duty);
|
w.set_b(duty);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user