Skip to content

B1: QI hysteresis + battery smoothing; independent E/B versions + CI E-skip - #53

Merged
avillach merged 1 commit into
mainfrom
b1/qi-hysteresis-and-batt-smoothing
Jun 29, 2026
Merged

avillach merged 1 commit into
mainfrom
b1/qi-hysteresis-and-batt-smoothing

Conversation

@avillach

Copy link
Copy Markdown
Contributor

Follow-up to the B1 power/OTA work. Fixes the on-pad UI twitchiness seen when a board is imperfectly aligned on the Qi pad (the link cycles → screen flips charging↔nav, gauge bounces), and decouples E/B so B-only changes stop disturbing the E fleet.

Firmware (B-only, #ifdef BUILD_B1)

  • QI_PRESENT asymmetric hysteresis — latch ON in ~200 ms (docking still stops recording promptly), but require ~2.5 s of sustained loss before declaring OFF. A brief Qi-link wobble no longer flips the display or resets the store-and-forget / off-pad timers. A real lift holds QI low continuously, so OFF still fires in ~2.5 s.
  • EMA-smoothed battery % so the flaky B1 GPIO34 sense stops bouncing read-to-read.

Versioning + CI (the E-protection you asked for)

  • Independent E/B FW_VERSION via #ifdef BUILD_B1: E stays 2026.06.29.02, B → 2026.06.29.03. A B-only change no longer re-revs E.
  • CI extracts both versions, builds/names/publishes each variant at its own version.
  • publish_variant now skips a variant whose freshly-built binary sha matches the live manifest → the unchanged E build is not re-uploaded or re-manifested. And because E's version is unchanged regardless, E boats do not re-OTA even if the skip doesn't trigger (belt + suspenders).

Effect of merging

  • B1 + B2 OTA to 2026.06.29.03 (next time they're docked/charging on WiFi).
  • E fleet: untouched — E version unchanged, E binary unchanged → no E re-OTA.

E binary verified to still compile at 1592239 bytes (unchanged size); B at 1594707.

🤖 Generated with Claude Code

…ns + CI skip

Hardening for imperfect Qi-pad coupling (a misaligned pad cycles the link):
- QI_PRESENT asymmetric debounce — quick to latch ON (docking stops recording
  promptly) but ~2.5 s sustained loss before declaring OFF, so a brief wobble
  no longer flips the charging<->nav screen or resets the on-pad timers.
- EMA-smooth the flaky B1 battery sense so the gauge stops bouncing (the
  34/45/38% chatter seen on a poorly-coupled pad).

Versioning/CI: E and B now carry independent FW_VERSION (E 2026.06.29.02,
B 2026.06.29.03) so a B-only change never re-revs the E fleet. CI extracts both,
names/publishes each variant at its own version, and publish_variant now SKIPS a
variant whose binary is byte-identical to the live manifest — so the unchanged E
build is neither re-uploaded nor re-manifested, and E boats do not re-OTA.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@avillach
avillach merged commit 240deba into main Jun 29, 2026
1 check passed
@avillach
avillach deleted the b1/qi-hysteresis-and-batt-smoothing branch June 29, 2026 23:26
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