Skip to content

hx20: CHG_LIMIT_GET_LIMIT disables charge override #6

@DHowett

Description

@DHowett

Querying the charge limit with host command CHARGE_LIMIT_CONTROL mode CHG_LIMIT_GET_LIMIT reloads the charge limit from bbram, which overwrites the CHG_LIMIT_OVERRIDE flag.

Flag is set here (and not stored to bbram, because it is a one-time override):

if (p->modes & CHG_LIMIT_OVERRIDE)
charging_maximum_level = charging_maximum_level | CHG_LIMIT_OVERRIDE;

and cleared when we read into charging_maximum_level here:

if (p->modes & CHG_LIMIT_GET_LIMIT) {
system_get_bbram(SYSTEM_BBRAM_IDX_CHG_MAX, &charging_maximum_level);

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