8000 Merge pull request #6816 from dhalbert/7.3.x-6798-backport · squix78/circuitpython@fdda9c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit fdda9c0

Browse files
authored
Merge pull request adafruit#6816 from dhalbert/7.3.x-6798-backport
7.3.x adafruit#6798 backport (zero-length pulse Pulseout fix
2 parents 0a29dc8 + e700481 commit fdda9c0

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_index < pulse_array_length &&
79+
pulse_array[pulse_array_index] == 0) {
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