fix bad indexing of lookup table
This commit is contained in:
parent
ed088b770d
commit
e41c11d0a1
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ uint8_t lithium_ion_mv_to_pct(int16_t batt_mv) {
|
|||
return battery_lookup[0].percent;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(battery_lookup); i++) {
|
||||
for (int i = 1; i < ARRAY_SIZE(battery_lookup); i++) {
|
||||
struct lookup_point one = battery_lookup[i - 1];
|
||||
struct lookup_point two = battery_lookup[i];
|
||||
if (batt_mv >= two.millivolts) {
|
||||
|
|
Loading…
Add table
Reference in a new issue