Repository navigation
feat(mock): Make second fuel gauge opt-in - #56
Merged
tullom merged 1 commit intoNov 10, 2026
Merged
Conversation
tullom
requested review from
dymk,
kat-perez,
maxperga-msft and
rogurr
and
a balanced review from Copilot
November 10, 2026 19:33
There was a problem hiding this comment.
🟢 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-gaugeinplatform-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
kurtjd
approved these changes
Nov 10, 2026
rogurr
approved these changes
Nov 10, 2026
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.
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.