Skip to content

[Battery pak] "Current" shows the previous level; "Remaining" stuck on "calculating" after sleep #902

Open

Description

@puchupala

⚠️ AI-assisted report. Written by an AI coding agent (Claude Code) under my direction; the device checks are mine.

Device: Anbernic RG SP (h700), Base OS 1.5.3, NextUI 6.15.0. The pak code is shared, so every platform is affected.

The Battery pak's "Current" disagrees with the status-bar pill, usually by one step and by much more after a sleep. Right after a 15 h sleep: pill 74, "Current: 83%", "Remaining: calculating".

Battery pak showing Current 83% and Remaining calculating while the status-bar pill reads 74

Cause: batmon logs each new level with duration 0 and fills it in at the next change or after 10 min. compute_graph() in workspace/all/battery/battery.c takes the newest row whose duration is already non-zero, i.e. the previous level. The same stale row overwrites the right edge of the graph, which the "Remaining" slope reads, so the estimate overshoots the 15 h cap and shows "calculating".

Also noted in the comments on #867 ("the number you can find in the battery app is rarely the same").

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions