We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a92eea3 + 43c3d9d commit 26b0a55Copy full SHA for 26b0a55
src/power.cpp
@@ -237,7 +237,8 @@ uint8_t read_battlevel(mapFn_t mapFunction) {
237
#ifdef HAS_IP5306
238
batt_percent = IP5306_GetBatteryLevel();
239
#elif defined HAS_PMU
240
- batt_percent = pmu.getBatteryPercent();
+ int bp = pmu.getBatteryPercent();
241
+ batt_percent = bp < 0 ? 0 : bp;
242
#else
243
const uint16_t batt_voltage = read_voltage();
244
if (batt_voltage <= BAT_MIN_VOLTAGE)
0 commit comments