From d1861a6b9c9f1a4624e13f6253254709b0fcd8d4 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 25 Apr 2021 14:24:21 -0500 Subject: [PATCH] Reset buffer index in PulseIn clear --- ports/raspberrypi/common-hal/pulseio/PulseIn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index 278c0cd662..878439a532 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -180,6 +180,7 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t *self) { self->start = 0; self->len = 0; + buf_index = 0; } uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) {