Skip to content

Commit

Permalink
addressing review comments from #9563
Browse files Browse the repository at this point in the history
  • Loading branch information
potaito committed May 30, 2018
1 parent 312462b commit e4c110e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/commander/commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2741,13 +2741,14 @@ Commander::run()
arm_auth_update(now, params_updated || param_init_forced);

// Handle shutdown request from emergency battery action
if(dangerous_battery_level_requests_poweroff){
if(!armed.armed && dangerous_battery_level_requests_poweroff){
mavlink_log_critical(&mavlink_log_pub, "DANGEROUSLY LOW BATTERY, SHUT SYSTEM DOWN");
usleep(200000);
int ret_val = px4_shutdown_request(false, false);

if (ret_val) {
mavlink_log_critical(&mavlink_log_pub, "SYSTEM DOES NOT SUPPORT SHUTDOWN");
dangerous_battery_level_requests_poweroff = false;

} else {
while (1) { usleep(1); }
Expand Down

0 comments on commit e4c110e

Please sign in to comment.