From c26f1b63635c90d9bd82d87db6ab4d9048b3a1b5 Mon Sep 17 00:00:00 2001 From: sean <1026025056@qq.com> Date: Sun, 4 Feb 2024 11:44:38 +0800 Subject: [PATCH] update axp ext power input issues --- src/AXP.cpp | 6 +++++- src/AXP192.cpp | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) 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);