diff --git a/app/module/drivers/sensor/battery/battery_common.c b/app/module/drivers/sensor/battery/battery_common.c index 73b60e9c..b582e317 100644 --- a/app/module/drivers/sensor/battery/battery_common.c +++ b/app/module/drivers/sensor/battery/battery_common.c @@ -50,7 +50,7 @@ uint8_t lithium_ion_mv_to_pct(int16_t batt_mv) { return 100; } - 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) { @@ -62,4 +62,4 @@ uint8_t lithium_ion_mv_to_pct(int16_t batt_mv) { } return 0; -} \ No newline at end of file +}