Battery handling: Make critical state accessible

This commit is contained in:
Lorenz Meier
2016-04-23 15:47:20 +02:00
parent 268b2e3546
commit ba817c7e45

View File

@@ -163,10 +163,11 @@ void
Battery::determineWarning()
{
// TODO: Determine threshold or make params.
if (_remaining < 0.18f) {
_warning = battery_status_s::BATTERY_WARNING_LOW;
} else if (_remaining < 0.09f) {
// Smallest values must come first
if (_remaining < 0.09f) {
_warning = battery_status_s::BATTERY_WARNING_CRITICAL;
} else if (_remaining < 0.18f) {
_warning = battery_status_s::BATTERY_WARNING_LOW;
}
}