[FL-2202] Reinit gauge after profile update (#962)

* bq27220: reinit gauge after profile update
* Firmware: update battery capacity to enforce gauge reinit for everyone.

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
gornekich 2022-01-14 21:14:25 +03:00 committed by GitHub
parent 8f8aba2a34
commit 32c92a80ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -42,8 +42,8 @@ const ParamCEDV cedv = {
.IGNORE_SD = 1, .IGNORE_SD = 1,
.SME0 = 0, .SME0 = 0,
}, },
.full_charge_cap = 2100, .full_charge_cap = 2101,
.design_cap = 2100, .design_cap = 2101,
.EDV0 = 3300, .EDV0 = 3300,
.EDV1 = 3321, .EDV1 = 3321,
.EDV2 = 3355, .EDV2 = 3355,

View File

@ -42,8 +42,8 @@ const ParamCEDV cedv = {
.IGNORE_SD = 1, .IGNORE_SD = 1,
.SME0 = 0, .SME0 = 0,
}, },
.full_charge_cap = 2100, .full_charge_cap = 2101,
.design_cap = 2100, .design_cap = 2101,
.EDV0 = 3300, .EDV0 = 3300,
.EDV1 = 3321, .EDV1 = 3321,
.EDV2 = 3355, .EDV2 = 3355,

View File

@ -102,7 +102,7 @@ bool bq27220_init(FuriHalI2cBusHandle* handle, const ParamCEDV* cedv) {
bq27220_set_parameter_u16(handle, AddressEDV1, cedv->EDV1); bq27220_set_parameter_u16(handle, AddressEDV1, cedv->EDV1);
bq27220_set_parameter_u16(handle, AddressEDV2, cedv->EDV2); bq27220_set_parameter_u16(handle, AddressEDV2, cedv->EDV2);
bq27220_control(handle, Control_EXIT_CFG_UPDATE); bq27220_control(handle, Control_EXIT_CFG_UPDATE_REINIT);
delay_us(10000); delay_us(10000);
design_cap = bq27220_get_design_capacity(handle); design_cap = bq27220_get_design_capacity(handle);
if(cedv->design_cap == design_cap) { if(cedv->design_cap == design_cap) {