battery on Screen fix for axp2101

This commit is contained in:
richonguzman 2024-09-19 10:48:00 -03:00
parent ef6eb5bd29
commit 4825385d2f
2 changed files with 4 additions and 9 deletions

View File

@ -47,7 +47,7 @@ TinyGPSPlus gps;
OneButton userButton = OneButton(BUTTON_PIN, true, true); OneButton userButton = OneButton(BUTTON_PIN, true, true);
#endif #endif
String versionDate = "2024.09.18"; String versionDate = "2024.09.19";
uint8_t myBeaconsIndex = 0; uint8_t myBeaconsIndex = 0;
int myBeaconsSize = Config.beacons.size(); int myBeaconsSize = Config.beacons.size();

View File

@ -160,14 +160,9 @@ namespace POWER_Utils {
void obtainBatteryInfo() { void obtainBatteryInfo() {
static unsigned int rate_limit_check_battery = 0; static unsigned int rate_limit_check_battery = 0;
if (!(rate_limit_check_battery++ % 60)) if (!(rate_limit_check_battery++ % 60)) BatteryIsConnected = isBatteryConnected();
BatteryIsConnected = isBatteryConnected();
if (BatteryIsConnected) { if (BatteryIsConnected) {
#ifdef HAS_AXP2101
batteryVoltage = String(PMU.getBattVoltage()/1000);
#else
batteryVoltage = String(getBatteryVoltage(), 2); batteryVoltage = String(getBatteryVoltage(), 2);
#endif
batteryChargeDischargeCurrent = String(getBatteryChargeDischargeCurrent(), 0); batteryChargeDischargeCurrent = String(getBatteryChargeDischargeCurrent(), 0);
} }
} }