Added battery doubleprogressbar

This commit is contained in:
CommanderRedYT
2021-12-11 05:05:46 +01:00
parent 70382088a0
commit 508c90800a
12 changed files with 136 additions and 11 deletions

View File

@@ -456,5 +456,19 @@ extern "C" void app_main()
if (settings.cloudSettings.udpCloudEnabled)
sendUdpCloudPacket();
#endif
if (battery::bootBatPercentage == -1)
{
if(controllers.front.feedbackValid && controllers.back.feedbackValid)
{
float avgVoltage = 0;
for (auto &controller : controllers)
{
avgVoltage += controller.getCalibratedVoltage();
}
avgVoltage = avgVoltage / controllers.size();
if (avgVoltage > 30)
battery::bootBatPercentage = getBatteryPercentage(avgVoltage, BatteryCellType(settings.battery.cellType));
}
}
}
}