mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-26 17:00:36 +08:00
Battery handling: Make critical state accessible
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user