Merge pull request #6798 from DavePutz/issue_6735

Fix handling of zero-length pulseout pulse
This commit is contained in:
Dan Halbert 2022-08-25 07:49:28 -04:00 committed by GitHub
commit 83838fc4fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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) {