We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a7280d commit 1030bf6Copy full SHA for 1030bf6
1 file changed
board/hx20/board.c
@@ -827,15 +827,20 @@ void charger_update(void)
827
{
828
static int pre_ac_state;
829
static int pre_dc_state;
830
- uint16_t val = 0x0000;
+ int val = 0x0000;
831
832
if (pre_ac_state != extpower_is_present() ||
833
pre_dc_state != battery_is_present())
834
835
CPRINTS("update charger!!");
836
837
- val = ISL9241_CONTROL1_PROCHOT_REF_6800 |
838
- ISL9241_CONTROL1_SWITCH_FREQ;
+ if (i2c_read16(I2C_PORT_CHARGER, ISL9241_ADDR_FLAGS,
+ ISL9241_REG_CONTROL1, &val)) {
839
+ CPRINTS("read charger control1 fail");
840
+ }
841
+
842
+ val |= (ISL9241_CONTROL1_PROCHOT_REF_6800 |
843
+ ISL9241_CONTROL1_SWITCH_FREQ);
844
845
if (i2c_write16(I2C_PORT_CHARGER, ISL9241_ADDR_FLAGS,
846
ISL9241_REG_CONTROL1, val)) {
0 commit comments