mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 00:05:34 +08:00
commander: fix emergency power off
From what I can see the CONFIG_BOARDCTL_POWEROFF is not really used anywhere, however, the BOARD_HAS_POWER_CONTROL is something that is set, e.g. for the Mantis, to allow power off.
This commit is contained in:
@@ -3734,7 +3734,7 @@ void Commander::battery_status_check()
|
||||
if (update_internal_battery_state) {
|
||||
|
||||
if (_battery_warning == battery_status_s::BATTERY_WARNING_EMERGENCY) {
|
||||
#if defined(CONFIG_BOARDCTL_POWEROFF)
|
||||
#if defined(BOARD_HAS_POWER_CONTROL)
|
||||
|
||||
if (shutdown_if_allowed() && (px4_shutdown_request(400_ms) == 0)) {
|
||||
mavlink_log_critical(&_mavlink_log_pub, "Dangerously low battery! Shutting system down\t");
|
||||
@@ -3752,7 +3752,7 @@ void Commander::battery_status_check()
|
||||
"Dangerously low battery! System shut down failed");
|
||||
}
|
||||
|
||||
#endif // CONFIG_BOARDCTL_POWEROFF
|
||||
#endif // BOARD_HAS_POWER_CONTROL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user