Repository navigation
refactor(gpio): share async lifecycle and isolate per-pin waits - #21
Draft
sanchuanhehe wants to merge 3 commits into
Draft
sanchuanhehe wants to merge 3 commits into
sanchuanhehe wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GPIO async waits now share a PAC-independent lifecycle for first-poll setup, Waker registration, latched completion and cancellation. WS53 retains whole-bank handoff; WS63 retains per-pin ownership, with IRQ bindings and pin count in SoC configuration. No executor, time queue or Embassy dependency is added.
WS63 previously used one completion flag per bank, allowing empty/unrelated IRQs to complete the wrong wait, and did not stop cancelled waits. Per-pin slots fix this. Temporary masking now uses an experimental
interrupt::maskthat preserves pending events: cancelling one pin or re-polling must not acknowledge another latched event. Existingdisablekeeps its mask-and-clear behavior. The changes are split into behavior-preserving extraction, per-pin adaptation, and pending-preservation commits.Validation: independent host tests WS63/WS53/BS21 358/438/220; all three target Clippy checks, WS53/WS63 doctests, no-Embassy graphs and register policy pass. Parent QEMU covers simultaneous same-bank waits, empty IRQ, three cancellations including an already-pending peer, immediate levels and edges. WS53 retains eight wakes/two cancellations and adds directional-edge re-poll before ISR. The original baseline fails the empty-IRQ assertion; the intermediate revision fails the pending-peer case. Both failures are preserved. The final pinned remote consumer links and passes the WS63 model scenario without parent patches.
No hardware operations or new physical qualification. Stable interfaces and BS21 async capabilities remain unchanged. Physical acknowledgement timing, cross-core/unrelated-ISR register arbitration, legacy any-edge setup limitations, block_on wake/idle and DMA safety remain open. Stacked on fix/dma-controller-lifetime.