Do not wait when the pwm is disabled
Reason: because in this case no seqend event is raised and therefore an infinity loop occurs
This commit is contained in:
parent
b08a0955c3
commit
319b0fe3d7
1 changed files with 3 additions and 1 deletions
|
@ -760,7 +760,9 @@ impl<'d, T: Instance> SimplePwm<'d, T> {
|
|||
|
||||
// defensive wait until waveform is loaded after seqstart so set_duty
|
||||
// can't be called again while dma is still reading
|
||||
while r.events_seqend[0].read().bits() == 0 {}
|
||||
if self.is_enabled() {
|
||||
while r.events_seqend[0].read().bits() == 0 {}
|
||||
}
|
||||
}
|
||||
|
||||
/// Sets the PWM clock prescaler.
|
||||
|
|
Loading…
Add table
Reference in a new issue