Merge pull request #8505 from Snipeye/fix_pulseio_rp2040_interrupt

Fixed the RP2040 interrupt problem
This commit is contained in:
Dan Halbert 2023-10-23 20:18:39 -04:00 committed by GitHub
commit 2c25e82feb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}