Skip to content

feat(i14-power,i14-ui): HW-CAR coulomb-counter fuel gauge and charge/discharge ETA - #2

Merged
brainbudt merged 2 commits into
mainfrom
feat/i14-hw-car-fuel-gauge
Nov 22, 2026
Merged

brainbudt merged 2 commits into
mainfrom
feat/i14-hw-car-fuel-gauge

Conversation

@brainbudt

Copy link
Copy Markdown
Owner

Summary

  • Replace the raw FG_g_fg_dbg_bat_zcv OCV lookup in i14-battery-guard with an Android-grade hardware coulomb-counter (FG_g_fg_dbg_car) fuel gauge (fuel_gauge.rs) that tracks q_rem_mah and q_max_mah across charging, discharging, USB/charger resets, and reboots.
  • Persist fuel-gauge state atomically to /mnt/data/media/0/i14-linux/battery-state.json and expose gauge_mode and q_rem_mah / q_max_mah in /run/i14-charge-status.json.
  • Display anchored SOC (68% instead of ~4%) and estimated remaining charge / discharge time (~1h 58m to full, ~20m to 80%, ~11h 15m left) alongside the live current on the i14-ui home screen.

Verification

  • cargo fmt --all -- --check passed
  • cargo clippy --all-targets -- -D warnings passed
  • cargo test -p i14-config -p i14-power -p i14-ui passed (including HW-CAR fuel-gauge unit/replay tests and i14-ui ETA/parity tests)
  • Cross-compiled (aarch64-unknown-linux-musl) and live-verified on the I14 phone (i14-battery-guard + i14-ui)

@brainbudt
brainbudt merged commit e0b84ff into main Nov 22, 2026
8 checks passed
@brainbudt
brainbudt deleted the feat/i14-hw-car-fuel-gauge branch November 22, 2026 22:24
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