File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -827,15 +827,20 @@ void charger_update(void)
827
827
{
828
828
static int pre_ac_state ;
829
829
static int pre_dc_state ;
830
- uint16_t val = 0x0000 ;
830
+ int val = 0x0000 ;
831
831
832
832
if (pre_ac_state != extpower_is_present () ||
833
833
pre_dc_state != battery_is_present ())
834
834
{
835
835
CPRINTS ("update charger!!" );
836
836
837
- val = ISL9241_CONTROL1_PROCHOT_REF_6800 |
838
- ISL9241_CONTROL1_SWITCH_FREQ ;
837
+ if (i2c_read16 (I2C_PORT_CHARGER , ISL9241_ADDR_FLAGS ,
838
+ ISL9241_REG_CONTROL1 , & val )) {
839
+ CPRINTS ("read charger control1 fail" );
840
+ }
841
+
842
+ val |= (ISL9241_CONTROL1_PROCHOT_REF_6800 |
843
+ ISL9241_CONTROL1_SWITCH_FREQ );
839
844
840
845
if (i2c_write16 (I2C_PORT_CHARGER , ISL9241_ADDR_FLAGS ,
841
846
ISL9241_REG_CONTROL1 , val )) {
You can’t perform that action at this time.
0 commit comments