Decouple embassy-hal-common InterruptExt from cortex-m #1689
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Decouples
embassy_hal_common::interrupt
from Cortex-M and Cortex-M dependencies, allowing implementations ofembassy_hal_common::interrupt::InterruptExt
for non-NVIC interrupt controllers (PLIC, CLIC, GIC, ...). Adds a sample implementation for the RISC-V PLIC from the riscv crate.There are a couple of things to highlight:
InterruptExt
is unopinionated about how to handle such feature gaps in interrupt controller implementations. The RISC-V PLIC also supports a priority threshold.embassy-hal-common/prio-bits-2
.Nonetheless this begins to decouple the
InterruptExt
abstraction from the NVIC, allow of non-NVIC implementations, and maintains backwards compatibility.