commander: reboot/shutdown usability fixes

- always check with state machine before reboot/shutdown
 - respect BOARD_HAS_POWER_CONTROL (shutdown from command, low battery, power button)
 - px4_shutdown_request add optional delay and always execute from HPWORK
 - px4_shutdown_request split out px4_reboot_request
This commit is contained in:
Daniel Agar
2020-05-06 13:53:54 -04:00
parent 45ebbb895a
commit 746a8f5cf9
96 changed files with 332 additions and 528 deletions
+1 -2
View File
@@ -33,7 +33,6 @@
px4_add_module(
MODULE systemcmds__shutdown
MAIN shutdown
COMPILE_FLAGS
SRCS
shutdown.c
shutdown.cpp
)
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (C) 2016 PX4 Development Team. All rights reserved.
* Copyright (C) 2016-2020 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,16 +35,10 @@
* @file shutdown.c
* Tool similar to UNIX shutdown command.
*/
#include <px4_platform_common/shutdown.h>
#include <px4_platform_common/tasks.h>
__EXPORT int shutdown_main(int argc, char *argv[]);
int shutdown_main(int argc, char *argv[])
extern "C" __EXPORT int shutdown_main(int argc, char *argv[])
{
(void)argc;
(void)argv;
const bool to_bootloader = false;
px4_systemreset(to_bootloader);
return px4_shutdown_request();
}