mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 03:24:06 +08:00
commander: use shutdown_if_allowed() to check for shutdown safety
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
This commit is contained in:
parent
5133453822
commit
4d5f922e7a
@ -3867,9 +3867,9 @@ void Commander::battery_status_check()
|
||||
}
|
||||
|
||||
// Handle shutdown request from emergency battery action
|
||||
if (!armed.armed && (battery.warning != _battery_warning)) {
|
||||
if (battery.warning != _battery_warning) {
|
||||
|
||||
if (battery.warning == battery_status_s::BATTERY_WARNING_EMERGENCY) {
|
||||
if ((battery.warning == battery_status_s::BATTERY_WARNING_EMERGENCY) && shutdown_if_allowed()) {
|
||||
mavlink_log_critical(&mavlink_log_pub, "Dangerously low battery! Shutting system down");
|
||||
px4_usleep(200000);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user