Skip to content

Commit

Permalink
[ion/battery] Doubled hysteresis to avoid sudden fluctuactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Overengined authored and M4xi1m3 committed Jul 7, 2021
1 parent ef45fab commit c8afdca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ion/src/device/shared/drivers/battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit c8afdca

Please sign in to comment.