[DO NOT MERGE] Diagnostic: -159 broadcast fix + deep-sleep HUD#52
Draft
Coral-coder wants to merge 2 commits into
Draft
[DO NOT MERGE] Diagnostic: -159 broadcast fix + deep-sleep HUD#52Coral-coder wants to merge 2 commits into
Coral-coder wants to merge 2 commits into
Conversation
Instrument the -159 build (the single-phone discoverable-advertising fix) with the deep-sleep HUD so we can read, on hardware, how much the chip actually sleeps right after the BLE broadcast fix. Ports the read-only deep-sleep tick counters plus the ms/s overlay onto this base: a discreet, transparent, unfocused modal shows "N ms/s asleep" and "N ms/s awake", averaged over the trailing minute, redrawn on each wake via the AppAndModal compositor path (no timer, no extra wake-ups). Toggle under Settings -> Debugging (sf32lb52 only), persisted across reboots via a shell pref. Diagnostic branch off c2a5a44 for the battery bisect; not intended for merge. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Coral Coder <dsthunder@gmail.com>
True deep sleep is unreachable in normal always-on use: it needs a >=50 ms uninterrupted idle window the workload rarely leaves, so the chip's real resting floor is deep WFI. The old HUD read the deep-sleep counter, which sits at ~0, and lumped deep WFI into "awake" -- misleading. Point the metric at the states the chip actually reaches: report a per-minute idle breakdown -- deep (deep WFI or deeper), light WFI, and running -- each in average ms per wall-clock second, summing to ~1000. Rename the debug row to "Idle States HUD". Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Coral Coder <dsthunder@gmail.com>
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.
Based on -159 (
c2a5a44d, the BLE broadcast fix), not currentmain. The diff shows everything since -159 as "reverted" plus the HUD on top — expected. This PR exists only so CI produces a flashable-159 + HUDartifact for the battery bisect.What the HUD shows (updated)
True DEEPSLEEP is unreachable on an always-on watch — it needs a ≥50 ms uninterrupted idle window the workload rarely leaves, so the chip's real floor is DEEP-WFI. The HUD (Settings → Debugging → "Idle States HUD", sf32lb52 only) now shows the per-minute idle breakdown, each in ms per wall-clock second (summing to ~1000):
deepwfi N— deep WFI or deeper (the low-power floor; DEEPSLEEP folded in, ~0 in practice)wfi N— light WFIrun N— CPU actually executingDiscreet transparent unfocused modal, redrawn on each wake via the
AppAndModalcompositor path — no timer, no extra wake-ups, nothing sampled while off. Toggle persists across reboots.How to read it
Flash, enable the HUD, park on a static watchface, wake and read:
deepwfi, lowrun→ the chip is resting well at -159; battery drain isn't CPU wakefulness.run→ something is churning the CPU (frequent wakeups) — that's also what keeps us out of true DEEPSLEEP.Full
obelix@pvtbuild compiles and links. Close without merging once the artifact is captured.