Skip to content

Commit

Permalink
Merge pull request #893 from cyberman54/development
Browse files Browse the repository at this point in the history
bugfix axp192 battpercent
  • Loading branch information
cyberman54 authored Sep 17, 2022
2 parents a92eea3 + 43c3d9d commit 26b0a55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ uint8_t read_battlevel(mapFn_t mapFunction) {
#ifdef HAS_IP5306
batt_percent = IP5306_GetBatteryLevel();
#elif defined HAS_PMU
batt_percent = pmu.getBatteryPercent();
int bp = pmu.getBatteryPercent();
batt_percent = bp < 0 ? 0 : bp;
#else
const uint16_t batt_voltage = read_voltage();
if (batt_voltage <= BAT_MIN_VOLTAGE)
Expand Down

0 comments on commit 26b0a55

Please sign in to comment.