Umgebaut
This commit is contained in:
@ -196,5 +196,5 @@ std::string getBatteryDebugString()
|
||||
}
|
||||
|
||||
namespace battery {
|
||||
float bootBatPercentage{-1};
|
||||
std::optional<float> bootBatPercentage;
|
||||
}
|
||||
|
@ -34,5 +34,5 @@ float getPercentageByWh(float wh);
|
||||
float getTarget_mAh();
|
||||
|
||||
namespace battery {
|
||||
extern float bootBatPercentage;
|
||||
extern std::optional<float> bootBatPercentage;
|
||||
}
|
||||
|
@ -102,7 +102,8 @@ void BatteryMenu::redraw()
|
||||
avgVoltage = avgVoltage / controllers.size();
|
||||
|
||||
const auto batPercent = getBatteryPercentage(avgVoltage, BatteryCellType(configs.battery.cellType.value));
|
||||
m_doubleProgressBarBatPercentage.redraw(batPercent, battery::bootBatPercentage);
|
||||
if (battery::bootBatPercentage)
|
||||
m_doubleProgressBarBatPercentage.redraw(batPercent, *battery::bootBatPercentage);
|
||||
}
|
||||
|
||||
void BatteryMenu::back()
|
||||
|
@ -113,7 +113,7 @@ extern "C" void app_main()
|
||||
lastStatsPush = now;
|
||||
}
|
||||
|
||||
if (battery::bootBatPercentage == -1)
|
||||
if (!battery::bootBatPercentage)
|
||||
{
|
||||
if(controllers.front.feedbackValid && controllers.back.feedbackValid)
|
||||
{
|
||||
|
Reference in New Issue
Block a user