From c8afdcacab7ee06f13a08c1de5b78147187c4a28 Mon Sep 17 00:00:00 2001 From: Hyperengined <71342876+Hyperengined@users.noreply.github.com> Date: Mon, 22 Mar 2021 10:15:52 +0100 Subject: [PATCH] [ion/battery] Doubled hysteresis to avoid sudden fluctuactions --- ion/src/device/shared/drivers/battery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ion/src/device/shared/drivers/battery.cpp b/ion/src/device/shared/drivers/battery.cpp index 779454096..c0f4877bd 100644 --- a/ion/src/device/shared/drivers/battery.cpp +++ b/ion/src/device/shared/drivers/battery.cpp @@ -30,7 +30,7 @@ Charge level() { constexpr static int numberOfChargeStates = 4; constexpr static int numberOfThresholds = numberOfChargeStates - 1; - constexpr float hysteresis = 0.02f; + constexpr float hysteresis = 0.04f; const float thresholds[numberOfThresholds] = {3.6f + hysteresis, 3.7f, 3.8f}; // We do not want to lower the threshold for empty battery, so we add the hysteresis to it int nextLevel = -1; for (int i = 0; i < numberOfThresholds; i++) {