fix Discard initial battery capacity reading

This commit is contained in:
robshape 2023-04-20 20:52:58 +02:00
parent 8d73b8de93
commit 4c5afd68e6

View file

@ -1399,6 +1399,10 @@ static void POW_updateBatteryStatus(void) {
// Battery ramp is wrong for bigger batteries. Need to log drain for 2600 mAh, 3500 mAh, and // Battery ramp is wrong for bigger batteries. Need to log drain for 2600 mAh, 3500 mAh, and
// update range. Reading /capacity seems more accurate for 2600 mAh. // update range. Reading /capacity seems more accurate for 2600 mAh.
int i = getInt("/sys/class/power_supply/battery/capacity"); int i = getInt("/sys/class/power_supply/battery/capacity");
if (i == 0) { // Initial reading is incorrect...
pow.charge = 100;
return;
}
// worry less about battery and more about the game you're playing // worry less about battery and more about the game you're playing
if (i>80) pow.charge = 100; if (i>80) pow.charge = 100;