Skip to content

Commit

Permalink
Merge pull request #8505 from Snipeye/fix_pulseio_rp2040_interrupt
Browse files Browse the repository at this point in the history
Fixed the RP2040 interrupt problem
  • Loading branch information
dhalbert authored Oct 24, 2023
2 parents 07e62b9 + ecf5a6b commit 2c25e82
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ports/raspberrypi/common-hal/pulseio/PulseIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) {
mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn);
}
uint16_t value = self->buffer[self->start];
common_hal_mcu_disable_interrupts();
self->start = (self->start + 1) % self->maxlen;
self->len--;
common_hal_mcu_enable_interrupts();
return value;
}

Expand Down

0 comments on commit 2c25e82

Please sign in to comment.