summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorminacode <minamoto9@web.de>2022-10-31 22:08:41 +0100
committerJF <JF002@users.noreply.github.com>2022-12-27 12:13:52 +0100
commit60027f217ccf13f0503658b6bfa2613bfa406a12 (patch)
treef0ffae52c88a1870901fd1662e7434563f6813ba /src
parent276b17979e4eb8ec0485e20c8006f454658097a2 (diff)
cutout scaling hack
Diffstat (limited to 'src')
-rw-r--r--src/components/battery/BatteryController.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp
index a207acda..a64ea076 100644
--- a/src/components/battery/BatteryController.cpp
+++ b/src/components/battery/BatteryController.cpp
@@ -85,11 +85,6 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) {
if (!isFull) {
newPercent = std::min(aprox.GetValue(voltage), isCharging ? uint8_t {99} : uint8_t {100});
}
- // quick hack for better values
- // rescale the percentages between 35 and 100
- constexpr uint8_t realMin = 35;
- newPercent = std::max(newPercent, realMin);
- newPercent = (newPercent - realMin) * 100 / (100 - realMin);
if ((isPowerPresent && newPercent > percentRemaining) || (!isPowerPresent && newPercent < percentRemaining) || firstMeasurement) {
firstMeasurement = false;