Update PulseIn.c
This commit is contained in:
parent
c014ac3089
commit
2eca4ee902
@ -115,11 +115,11 @@ void pulsein_interrupt_handler(uint8_t channel) {
|
|||||||
duration = total_diff;
|
duration = total_diff;
|
||||||
}
|
}
|
||||||
//check if the input is taking too long, 15 timer overflows is approx 1 second
|
//check if the input is taking too long, 15 timer overflows is approx 1 second
|
||||||
if (current_overflow - start_overflow > 15) {
|
if (current_overflow - start_overflow > 15) {
|
||||||
self->errored_too_fast = true;
|
self->errored_too_fast = true;
|
||||||
common_hal_pulseio_pulsein_pause(self);
|
common_hal_pulseio_pulsein_pause(self);
|
||||||
common_hal_mcu_enable_interrupts();
|
common_hal_mcu_enable_interrupts();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t i = (self->start + self->len) % self->maxlen;
|
uint16_t i = (self->start + self->len) % self->maxlen;
|
||||||
|
Loading…
Reference in New Issue
Block a user