mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-26 22:40:25 +00:00
Drivers: remove excessive check in bq25896 and make PVS happy (#2436)
This commit is contained in:
parent
b054912167
commit
478390de19
1 changed files with 0 additions and 6 deletions
|
@ -151,12 +151,6 @@ void bq25896_set_vreg_voltage(FuriHalI2cBusHandle* handle, uint16_t vreg_voltage
|
||||||
// Values are truncated downward as needed (e.g. 4200mV -> 4192 mV)
|
// Values are truncated downward as needed (e.g. 4200mV -> 4192 mV)
|
||||||
bq25896_regs.r06.VREG = (uint8_t)((vreg_voltage - 3840) / 16);
|
bq25896_regs.r06.VREG = (uint8_t)((vreg_voltage - 3840) / 16);
|
||||||
|
|
||||||
// Double check: do not allow values above 23 (0x17, 4208mV)
|
|
||||||
// Exceeding 4.2v will overcharge the battery!
|
|
||||||
if(bq25896_regs.r06.VREG > 23) {
|
|
||||||
bq25896_regs.r06.VREG = 23;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply changes
|
// Apply changes
|
||||||
furi_hal_i2c_write_reg_8(
|
furi_hal_i2c_write_reg_8(
|
||||||
handle, BQ25896_ADDRESS, 0x06, *(uint8_t*)&bq25896_regs.r06, BQ25896_I2C_TIMEOUT);
|
handle, BQ25896_ADDRESS, 0x06, *(uint8_t*)&bq25896_regs.r06, BQ25896_I2C_TIMEOUT);
|
||||||
|
|
Loading…
Reference in a new issue