EmbeddedController
EmbeddedController copied to clipboard
hx20: CHG_LIMIT_GET_LIMIT disables charge override
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):
https://github.com/FrameworkComputer/EmbeddedController/blob/6e38e82b9553240820c241c80a7d94fdc3ae5914/board/hx20/battery.c#L362-L363
and cleared when we read into charging_maximum_level here:
https://github.com/FrameworkComputer/EmbeddedController/blob/6e38e82b9553240820c241c80a7d94fdc3ae5914/board/hx20/battery.c#L365-L366