Stop PWM before assigning the new sequence
I had introduced a small bug in my last PR where I assigned the sequence before stopping the PWM. I now stop the PWM before doing that now. Also, corrected a math comment.
This commit is contained in:
@ -149,6 +149,8 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
|
||||
return Err(Error::SequenceTimesAtLeastOne);
|
||||
}
|
||||
|
||||
self.stop();
|
||||
|
||||
let r = T::regs();
|
||||
|
||||
r.seq0
|
||||
@ -165,8 +167,6 @@ impl<'d, T: Instance> SequencePwm<'d, T> {
|
||||
.cnt
|
||||
.write(|w| unsafe { w.bits(sequence.len() as u32) });
|
||||
|
||||
self.stop();
|
||||
|
||||
r.enable.write(|w| w.enable().enabled());
|
||||
|
||||
// defensive before seqstart
|
||||
|
Reference in New Issue
Block a user