summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavePutz <dwputz@gmail.com>2020-09-14 11:04:45 -0500
committerGitHub <noreply@github.com>2020-09-14 11:04:45 -0500
commit2eca4ee90244bc3c09999eb9efa5cd9ef611c3e3 (patch)
treefc58288802530fcbde99a34e13db11436510216e
parentc014ac308903f6f0224c667624609f02a624bac0 (diff)
Update PulseIn.c
-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;