Update PulseOut.c

reorder the tests for zero-length
This commit is contained in:
DavePutz 2022-08-23 15:58:27 -05:00 committed by GitHub
parent 3daebb36c3
commit c00a630f50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -75,8 +75,8 @@ static void pulseout_event_handler(nrf_timer_event_t event_type, void *p_context
pulse_array_index++;
// Ignore a zero-length pulse
while (pulse_array[pulse_array_index] == 0 &&
pulse_array_index < pulse_array_length) {
while (pulse_array_index < pulse_array_length &&
pulse_array[pulse_array_index] == 0) {
pulse_array_index++;
}