Skip to content
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

Experimental embassy changes #2701

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Dec 6, 2024

These changes build on embassy-rs/embassy#3593 and #2684

We now manage our own timer queues, which means that

  • if there are multiple queues (with integrated-timers), we can use a priority-limited mutex. This means that higher priority executors don't get blocked by lower priority ones (except for Priority1 which may be blocked by the thread mode executor, but that's it).
  • if there is only a single queue (integrated or generic), we use a max priority lock (same thing as above, but instead of a critical section we end up with a spin lock).
  • the embassy-side changes mean processing the timer queue has a much lower overhead when using integrated timers.

Configuration-wise, users have the options to select between:

  • N integrated queues (requires N alarms)
  • 1 integrated queue
  • generic timer queue (for RTIC, for example) - this is the default if integrated-timers is not set, but probably should be inverted at this point, or at least default to single-queue.
  • The size of the generic queue is configurable using ESP_HAL_EMBASSY_GENERIC_QUEUE_SIZE

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.

1 participant