Skip to content

Commit 5452515

Browse files
committed
Do not reset charge_max_level during CHG_LIMIT_GET_LIMIT
Fixes #6.
1 parent 6e38e82 commit 5452515

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

board/hx20/battery.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,9 @@ static enum ec_status cmd_charging_limit_control(struct host_cmd_handler_args *a
363363
charging_maximum_level = charging_maximum_level | CHG_LIMIT_OVERRIDE;
364364

365365
if (p->modes & CHG_LIMIT_GET_LIMIT) {
366-
system_get_bbram(SYSTEM_BBRAM_IDX_CHG_MAX, &charging_maximum_level);
367-
r->max_percentage = charging_maximum_level;
366+
uint8_t max = 0;
367+
system_get_bbram(SYSTEM_BBRAM_IDX_CHG_MAX, &max);
368+
r->max_percentage = max;
368369
args->response_size = sizeof(*r);
369370
}
370371

0 commit comments

Comments
 (0)