From 2eca4ee90244bc3c09999eb9efa5cd9ef611c3e3 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 14 Sep 2020 11:04:45 -0500 Subject: [PATCH] Update PulseIn.c --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 9a9bf57a0d..9930fe9c9f 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -115,11 +115,11 @@ void pulsein_interrupt_handler(uint8_t channel) { duration = total_diff; } //check if the input is taking too long, 15 timer overflows is approx 1 second - if (current_overflow - start_overflow > 15) { - self->errored_too_fast = true; - common_hal_pulseio_pulsein_pause(self); + if (current_overflow - start_overflow > 15) { + self->errored_too_fast = true; + common_hal_pulseio_pulsein_pause(self); common_hal_mcu_enable_interrupts(); - return; + return; } uint16_t i = (self->start + self->len) % self->maxlen;