suppress single-percent ADC noise for battery level

This commit is contained in:
DJ2LS
2026-06-08 08:57:40 +02:00
committed by DeFiDude
parent f6d6aff288
commit 29a74c2cd9
+4 -1
View File
@@ -177,7 +177,10 @@ void LvStatusBar::setGPSFix(bool hasFix) {
void LvStatusBar::setBatteryPercent(int pct) {
pct = normalizedBattery(pct);
if (_battPct == pct) return;
// Suppress single-percent ADC noise: only update if the value changed by 2% or more
if (_battPct >= 0 && abs(pct - _battPct) < 2) return;
_battPct = pct;
refreshBattery();
}