From c4c817828e9200d54a5b032c0746d73181d72fa8 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 9 May 2020 12:22:29 +0200 Subject: [PATCH] T-Beam v10 chare current control added (#604) --- src/hal/ttgobeam10.h | 4 +++- src/power.cpp | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hal/ttgobeam10.h b/src/hal/ttgobeam10.h index abebe0d5..49fb51d9 100644 --- a/src/hal/ttgobeam10.h +++ b/src/hal/ttgobeam10.h @@ -31,7 +31,9 @@ Reset -> reset device #define HAS_BUTTON GPIO_NUM_38 // middle on board button #define HAS_PMU 1 // AXP192 power management chip #define PMU_INT GPIO_NUM_35 // AXP192 interrupt - +#define PMU_CHGC AXP1XX_CHARGE_CUR_280MA // AXP102 battery charge current +// possible AXP192 battery charge current values (mA): +// 100/190/280/360/450/550/630/700/780/880/960/1000/1080/1160/1240/1320 #define HAS_LED NOT_A_PIN // GPS settings diff --git a/src/power.cpp b/src/power.cpp index 2c6012b5..7204b829 100644 --- a/src/power.cpp +++ b/src/power.cpp @@ -124,6 +124,11 @@ void AXP192_init(void) { pmu.setTimeOutShutdown(false); // no automatic shutdown pmu.setTSmode(AXP_TS_PIN_MODE_DISABLE); // TS pin mode off to save power +// set charge current according to user setting if we have +#ifdef PMU_CHGC + pmu.setChargeControlCur(PMU_CHGC); +#endif + // switch ADCs on pmu.adc1Enable(AXP202_BATT_VOL_ADC1, true); pmu.adc1Enable(AXP202_BATT_CUR_ADC1, true);