8000 Fix handling of zero-length pulseout pulse · squix78/circuitpython@f9e1fc1 · GitHub
[go: up one dir, main page]

Skip to content

Commit f9e1fc1

Browse files
DavePutzdhalbert
authored andcommitted
Fix handling of zero-length pulseout pulse
1 parent 4276b06 commit f9e1fc1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ports/nrf/common-hal/pulseio/PulseOut.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ static void pulseout_event_handler(nrf_timer_event_t event_type, void *p_context
7474
nrfx_timer_pause(timer);
7575

7676
pulse_array_index++;
77+
// Ignore a zero-length pulse
78+
while (pulse_array[pulse_array_index] == 0 &&
79+
pulse_array_index < pulse_array_length) {
80+
pulse_array_index++;
81+
}
7782

7883
// No more pulses. Turn off output and don't restart.
7984
if (pulse_array_index >= pulse_array_length) {

0 commit comments

Comments
 (0)
0