Skip to content

mpconfig: Use RUN_BACKGROUND_TASKS as the micropython event hook #10379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jepler
Copy link

@jepler jepler commented May 27, 2025

This is a newer abstraction in micropython; it'll for instance allow background tasks to be checked once per ms in the internal select module modselect.

Because MICROPY_INTERNAL_EVENT_HOOK is used in a few locations, our own CIRCUITPY-CHANGE call to RUN_BACKGROUND_TASKS can be nixed. Specifically, mp_event_handle_nowait calls MICROPY_INTERNAL_EVENT_HOOK so paths from it don't need RUN_BACKGROUND_TASKS anymore.

However, while I'm traveling, I don't have access to hardware, so this is actually untested.

This is a newer abstraction in micropython; it'll for instance
allow background tasks to be checked once per ms in the internal
select module modselect.

Because `MICROPY_INTERNAL_EVENT_HOOK` is used in a few locations,
our own CIRCUITPY-CHANGE call to `RUN_BACKGROUND_TASKS` can be
nixed. Specifically, `mp_event_handle_nowait` calls
`MICROPY_INTERNAL_EVENT_HOOK` so paths from it don't need
`RUN_BACKGROUND_TASKS` anymore.
@dhalbert
Copy link
Collaborator

I will be doing a MicroPython merge soon so I think I will wait on this a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants