Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azalea/lotus: CHG_LIMIT_GET_LIMIT disables override #42

Open
DHowett opened this issue Jun 2, 2024 · 0 comments
Open

azalea/lotus: CHG_LIMIT_GET_LIMIT disables override #42

DHowett opened this issue Jun 2, 2024 · 0 comments

Comments

@DHowett
Copy link
Contributor

DHowett commented Jun 2, 2024

This is a repeat of bug #6 for azalea and lotus

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.

The override flag is cleared when we read into charging_maximum_level here:

azalea

if (p->modes & CHG_LIMIT_GET_LIMIT) {
system_get_bbram(SYSTEM_BBRAM_IDX_CHARGE_LIMIT_MAX, &charging_maximum_level);
r->max_percentage = charging_maximum_level;
args->response_size = sizeof(*r);
}

lotus

if (p->modes & CHG_LIMIT_GET_LIMIT) {
system_get_bbram(SYSTEM_BBRAM_IDX_CHARGE_LIMIT_MAX, &charging_maximum_level);
r->max_percentage = charging_maximum_level;
args->response_size = sizeof(*r);
}

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

No branches or pull requests

1 participant