Skip to content

feat(mock): Make second fuel gauge opt-in - #56

Merged
tullom merged 1 commit into
OpenDevicePartnership:mainfrom
tullom:battery/feature-gate-second-fg
Nov 10, 2026
Merged

tullom merged 1 commit into
OpenDevicePartnership:mainfrom
tullom:battery/feature-gate-second-fg

Conversation

@tullom

@tullom tullom commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

The majority of ECs only have 1 fuel gauge/battery, so it makes more sense to keep that as the default behaviour. Adding the second fuel gauge to demonstrate capability is preserved but in a feature gate.

@tullom tullom self-assigned this Nov 10, 2026
@tullom
tullom requested a review from a team as a code owner November 10, 2026 19:33
@tullom
tullom requested review from dymk, kat-perez, maxperga-msft and rogurr and a balanced review from Copilot November 10, 2026 19:33
@tullom tullom added the enhancement New feature or request label Nov 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the single-gauge default and opt-in dual-gauge support.

No open issues 🎉

What changed in this PR

This PR makes the shared mock battery service use one fuel gauge by default, while preserving the two-battery demonstration through the opt-in dual-fuel-gauge feature.

Changes:

  • Conditionally initialize the second fuel gauge and size registration and task capacity to match.
  • Define dual-fuel-gauge in platform-common, enabling mock support.
  • Expose the feature through all five platform crates.
File Description
platform/​platform-common/​src/​mock/​battery.rs Gate the second gauge and adjust registration and task capacity.
platform/​platform-common/​Cargo.toml Define the opt-in feature with mock support.
platform/​dev-qemu/​Cargo.toml Forward the dual-gauge feature to platform-common.
platform/​dev-npcx/​Cargo.toml Forward the dual-gauge feature to platform-common.
platform/​dev-mec/​Cargo.toml Forward the dual-gauge feature to platform-common.
platform/​dev-mcxa/​Cargo.toml Forward the dual-gauge feature to platform-common.
platform/​dev-imxrt/​Cargo.toml Forward the dual-gauge feature to platform-common.

Review effort: Balanced

@tullom
tullom merged commit 8329cda into OpenDevicePartnership:main Nov 10, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants