Merge pull request #8505 from Snipeye/fix_pulseio_rp2040_interrupt
Fixed the RP2040 interrupt problem
This commit is contained in:
commit
2c25e82feb
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user