diff --git a/src/AXP.cpp b/src/AXP.cpp index ab16dec7..28380390 100644 --- a/src/AXP.cpp +++ b/src/AXP.cpp @@ -118,7 +118,11 @@ void AXP::begin() { ina3221.begin(&Wire1); axp2101.set_lcd_back_light_voltage(3000); axp2101.set_lcd_and_tf_voltage(3300); - axp2101.set_bus_5v(true); + if (ina3221.getVoltage(INA3221_CH2) > 4.5f) + axp2101.set_bus_5v(false); + else { + axp2101.set_bus_5v(true); + } axp2101.set_sys_led(true); } else { _pmic = pmic_unknown; diff --git a/src/AXP192.cpp b/src/AXP192.cpp index 5c2b4957..d8a5b432 100644 --- a/src/AXP192.cpp +++ b/src/AXP192.cpp @@ -59,8 +59,6 @@ void AXP192::begin() { delay(100); // I2C_WriteByteDataAt(0X15,0XFE,0XFF); - SetPeripherialsPower(true); - // axp: check v-bus status if (Read8bit(0x00) & 0x08) { Write1Byte(0x30, Read8bit(0x30) | 0x80);