Merge pull request #893 from cyberman54/development
bugfix axp192 battpercent
This commit is contained in:
commit
26b0a555b3
@ -237,7 +237,8 @@ uint8_t read_battlevel(mapFn_t mapFunction) {
|
|||||||
#ifdef HAS_IP5306
|
#ifdef HAS_IP5306
|
||||||
batt_percent = IP5306_GetBatteryLevel();
|
batt_percent = IP5306_GetBatteryLevel();
|
||||||
#elif defined HAS_PMU
|
#elif defined HAS_PMU
|
||||||
batt_percent = pmu.getBatteryPercent();
|
int bp = pmu.getBatteryPercent();
|
||||||
|
batt_percent = bp < 0 ? 0 : bp;
|
||||||
#else
|
#else
|
||||||
const uint16_t batt_voltage = read_voltage();
|
const uint16_t batt_voltage = read_voltage();
|
||||||
if (batt_voltage <= BAT_MIN_VOLTAGE)
|
if (batt_voltage <= BAT_MIN_VOLTAGE)
|
||||||
|
Loading…
Reference in New Issue
Block a user