From 98a2edb8a7a78804db49448a74268356902bd0f0 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Mon, 2 Sep 2019 18:18:06 +0200 Subject: [PATCH] AXP192 support fixes --- src/battery.cpp | 4 ++++ src/i2cscan.cpp | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/battery.cpp b/src/battery.cpp index 3af874d9..39b78683 100644 --- a/src/battery.cpp +++ b/src/battery.cpp @@ -52,6 +52,10 @@ uint16_t read_voltage() { digitalWrite(EXT_POWER_SW, EXT_POWER_OFF); #endif +#ifdef HAS_PMU + voltage = axp.getBattVoltage(); +#endif + return (uint16_t)voltage; #else return 0; diff --git a/src/i2cscan.cpp b/src/i2cscan.cpp index 35898f0d..fb07d034 100644 --- a/src/i2cscan.cpp +++ b/src/i2cscan.cpp @@ -80,9 +80,10 @@ void AXP192_init(void) { axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON); axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON); axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); - + axp.setChgLEDMode(AXP20X_LED_OFF); + //axp.setChgLEDMode(LED_BLINK_4HZ); + /* - axp.setChgLEDMode(LED_BLINK_4HZ); axp.setDCDC1Voltage(3300); pinMode(PMU_IRQ, INPUT_PULLUP);