mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 10:31:36 +08:00
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:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user