Repository navigation
Expose TimeAlarm source and wake signals - #968
Merged
dymk merged 2 commits intoNov 2, 2026
Merged
Conversation
dymk
marked this pull request as ready for review
October 2, 2026 20:28
dymk
requested review from
RobertZ2011,
felipebalbi,
jerrysxie and
williampMSFT
and
a balanced review from Copilot
and removed request for
Copilot
October 2, 2026 20:28
RobertZ2011
requested changes
Oct 2, 2026
williampMSFT
reviewed
Oct 5, 2026
williampMSFT
reviewed
Oct 5, 2026
williampMSFT
reviewed
Oct 5, 2026
williampMSFT
reviewed
Oct 5, 2026
dymk
force-pushed
the
dymk/time-alarm-wake-signal
branch
from
October 13, 2026 18:57
3e6aecd to
baf1a15
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The synchronization model, stale-expiry handling, public API behavior, and tests are consistent and complete.
0 open findings
What changed in this PR
Adds board-facing power-source selection and wake-level signaling while preserving AC as the default. Timer transitions and combined wake publication are serialized, preventing stale expiries from bypassing policy delays.
Changes:
- Adds synchronous AC/DC source selection.
- Publishes the combined triggered-wake level.
- Adds extensive source, latch, policy-delay, and concurrency tests.
Review Guide
- Source transitions now update timer activity synchronously.
- Expiry processing rejects superseded deadlines and atomically publishes wake state.
- Tests cover both sources, coalescing, rearming, and concurrent clears.
Potential Issues
No issues identified.
| File | Description |
|---|---|
time-alarm-service/src/lib.rs |
Exposes source selection and wake signaling with serialized updates. |
time-alarm-service/src/timer.rs |
Separates expiry waiting from synchronized expiry processing. |
time-alarm-service/src/timer/tests.rs |
Adds comprehensive behavioral and concurrency coverage. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Allow board code to select AC or DC synchronously and consume the latched wake-request level. Publish level changes when alarms expire or their latches clear, preserving the relay wire contract. Assisted-by: GitHub Copilot:gpt-6-astra Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dymk
force-pushed
the
dymk/time-alarm-wake-signal
branch
from
November 2, 2026 17:30
baf1a15 to
54eb80e
Compare
Move power-source selection and the wake-request level into the TimeAlarmService trait. Back the level with a Watch so each consumer gets its own receiver and is notified only when the level changes. Document why each timer test exists. Assisted-by: GitHub Copilot:claude-opus-5.5
williampMSFT
approved these changes
Nov 2, 2026
RobertZ2011
approved these changes
Nov 2, 2026
4 tasks done
4 tasks
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.
Add board-facing methods to select the active AC/DC timer and await changes to the wake-request level. The level remains asserted while either timer has a triggered-wake latch; clear, disable, and reprogram operations update it. Existing callers retain the AC startup default and the nine-command relay format is unchanged.
Source transitions and wake publication are serialized. A stale timer expiry can no longer bypass the remaining policy delay after a source change.
Part of #689. This supplies the library boundary for a CPU retention-wake test; it does not implement power-source hardware detection or prove host resume.
13 host tests pass, including 11 new source/latch/policy cases. Host and Thumb Clippy feature combinations and Thumb no_std builds pass. Stacked AC/DC CPU-retention wake, disconnected/inactive guard cases, clear/rearm, and existing native/Windows RTC regressions now pass through the board and virtual GPIO changes in OpenDevicePartnership/odp-platform-qemu-arm-virt#182.