Skip to content

Commit 576da73

Browse files
committed
Added check for maxlen
1 parent 95b7a59 commit 576da73

File tree

1 file changed

+2
-2
lines changed
  • ports/raspberrypi/common-hal/pulseio

1 file changed

+2
-2
lines changed

ports/raspberrypi/common-hal/pulseio/PulseIn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
b/*
1+
/*
22
* This file is part of the MicroPython project, http://micropython.org/
33
*
44
* The MIT License (MIT)
@@ -163,7 +163,7 @@ void common_hal_pulseio_pulsein_interrupt() {
163163
irq_clear(self->pio_interrupt);
164164
hw_clear_bits(&self->state_machine.pio->inte0, 1u << self->state_machine.state_machine);
165165
self->state_machine.pio->irq = 1u << self->state_machine.state_machine;
166-
// check for a pulse thats too long (2000 us) or maxlen reached, and reset
166+
// check for a pulse thats too long (4000 us) or maxlen reached, and reset
167167
if (( level_count > 4000 ) || (buf_index >= self->maxlen)) {
168168
pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, false);
169169
pio_sm_init(self->state_machine.pio, self->state_machine.state_machine, self->state_machine.offset, &self->state_machine.sm_config);

0 commit comments

Comments
 (0)