Skip to content

Add shared PendSV deferred service dispatcher#392

Open
crabel99 wants to merge 1 commit into
adafruit:masterfrom
crabel99:pendsv-support-clean
Open

Add shared PendSV deferred service dispatcher#392
crabel99 wants to merge 1 commit into
adafruit:masterfrom
crabel99:pendsv-support-clean

Conversation

@crabel99

Copy link
Copy Markdown

Summary

Adds a shared PendSV deferred-service dispatcher to the core.

What changed

  • Adds PendSV.h and PendSV.cpp.
  • Provides a small service registry for up to 32 deferred service handlers.
  • Allows interrupt-context code to mark a service pending with setPending().
  • Dispatches pending services from PendSV_Handler() instead of doing heavier work directly in an ISR.
  • Tracks pending counts per service so repeated ISR events are not collapsed into a single callback.
  • Limits dispatch work per PendSV entry to avoid starving normal thread-mode execution.

Why

This creates a reusable core primitive for libraries that need ISR-safe deferred work, especially DMA and async peripheral paths.

Validation

  • metro_m0: 24 succeeded, 0 failed, 37 skipped
  • metro_m4: 20 succeeded, 0 failed, 41 skipped
  • git diff --check: clean

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