summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/atmel-samd/common-hal/pulseio/PulseIn.c8
1 files 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 9a9bf57a0..9930fe9c9 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;