Skip to content
Snippets Groups Projects
Verified Commit 0869af63 authored by dos's avatar dos
Browse files

py,st3m: power: Move 100% handling to the LUT

It had no chance to be actually applied, as the next lines
always overwrote it with the value from LUT.
parent 6e79447f
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ class Power: ...@@ -32,6 +32,7 @@ class Power:
self._battery_percentage = -1 self._battery_percentage = -1
# LUT created from Joulescope measurement of "official" 2Ah Battery at 650mW discharge at 26°C and decimated from ~42k samples # LUT created from Joulescope measurement of "official" 2Ah Battery at 650mW discharge at 26°C and decimated from ~42k samples
self._batLUT = [ self._batLUT = [
(100, 4.120),
(99, 4.114), (99, 4.114),
(98, 4.109), (98, 4.109),
(97, 4.091), (97, 4.091),
...@@ -193,9 +194,6 @@ class Power: ...@@ -193,9 +194,6 @@ class Power:
# print(voltage) # print(voltage)
if voltage > 4.120:
percentage = 100
for i in range(len(self._batLUT)): for i in range(len(self._batLUT)):
if voltage >= self._batLUT[i][1]: if voltage >= self._batLUT[i][1]:
percentage = self._batLUT[i][0] percentage = self._batLUT[i][0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment