Skip to content

[DO NOT MERGE] Diagnostic: -159 broadcast fix + deep-sleep HUD#52

Draft
Coral-coder wants to merge 2 commits into
mainfrom
power/hud-on-159
Draft

[DO NOT MERGE] Diagnostic: -159 broadcast fix + deep-sleep HUD#52
Coral-coder wants to merge 2 commits into
mainfrom
power/hud-on-159

Conversation

@Coral-coder

@Coral-coder Coral-coder commented Jul 8, 2026

Copy link
Copy Markdown
Owner

⚠️ DO NOT MERGE — diagnostic build only

Based on -159 (c2a5a44d, the BLE broadcast fix), not current main. The diff shows everything since -159 as "reverted" plus the HUD on top — expected. This PR exists only so CI produces a flashable -159 + HUD artifact 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 WFI
  • run N — CPU actually executing

Discreet transparent unfocused modal, redrawn on each wake via the AppAndModal compositor 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:

  • High deepwfi, low run → the chip is resting well at -159; battery drain isn't CPU wakefulness.
  • High run → something is churning the CPU (frequent wakeups) — that's also what keeps us out of true DEEPSLEEP.

Full obelix@pvt build compiles and links. Close without merging once the artifact is captured.

Coral-coder and others added 2 commits July 8, 2026 11:12
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>
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