10000 Fix handling of zero-length pulseout pulse by DavePutz · Pull Request #6798 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

8000 Fix handling of zero-length pulseout pulse #6798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Split Diff View
Split
Diff view
5 changes: 5 additions & 0 deletions ports/nrf/common-hal/pulseio/PulseOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ static void pulseout_event_handler(nrf_timer_event_t event_type, void *p_context
nrfx_timer_pause(timer);

pulse_array_index++;
// Ignore a zero-length pulse
while (pulse_array_index < pulse_array_length &&
pulse_array[pulse_array_index] == 0) {
pulse_array_index++;
}

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