[ion/battery] Doubled hysteresis to avoid sudden fluctuactions

This commit is contained in:
Hyperengined
2021-03-22 10:15:52 +01:00
committed by M4x1m3
parent ef45fab63d
commit c8afdcacab

View File

@@ -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++) {