mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 11:23:34 +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:
@@ -58,7 +58,6 @@ set(srcs
|
||||
test_microbench_matrix.cpp
|
||||
test_microbench_uorb.cpp
|
||||
test_mixer.cpp
|
||||
test_mount.c
|
||||
test_param.c
|
||||
test_parameters.cpp
|
||||
test_perf.c
|
||||
@@ -80,6 +79,7 @@ set(srcs
|
||||
|
||||
if(${PX4_PLATFORM} STREQUAL "nuttx")
|
||||
list(APPEND srcs
|
||||
test_mount.cpp
|
||||
test_time.c
|
||||
test_uart_break.c
|
||||
)
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform_common/posix.h>
|
||||
#include <px4_platform_common/tasks.h>
|
||||
#include <px4_platform_common/shutdown.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
@@ -56,8 +57,7 @@
|
||||
const int fsync_tries = 1;
|
||||
const int abort_tries = 10;
|
||||
|
||||
int
|
||||
test_mount(int argc, char *argv[])
|
||||
int test_mount(int argc, char *argv[])
|
||||
{
|
||||
const unsigned iterations = 2000;
|
||||
const unsigned alignments = 10;
|
||||
@@ -289,7 +289,7 @@ test_mount(int argc, char *argv[])
|
||||
fsync(fileno(stdout));
|
||||
fsync(fileno(stderr));
|
||||
px4_usleep(50000);
|
||||
px4_systemreset(false);
|
||||
px4_reboot_request();
|
||||
|
||||
/* never going to get here */
|
||||
return 0;
|
||||
@@ -69,6 +69,7 @@ const struct {
|
||||
#ifdef __PX4_NUTTX
|
||||
{"file", test_file, OPT_NOJIGTEST | OPT_NOALLTEST},
|
||||
{"led", test_led, 0},
|
||||
{"mount", test_mount, OPT_NOJIGTEST | OPT_NOALLTEST},
|
||||
{"time", test_time, OPT_NOJIGTEST},
|
||||
{"uart_baudchange", test_uart_baudchange, OPT_NOJIGTEST},
|
||||
{"uart_break", test_uart_break, OPT_NOJIGTEST | OPT_NOALLTEST},
|
||||
@@ -102,7 +103,6 @@ const struct {
|
||||
{"microbench_uorb", test_microbench_uorb, 0},
|
||||
{"mixer", test_mixer, OPT_NOJIGTEST},
|
||||
{"mixer", test_mixer, OPT_NOJIGTEST},
|
||||
{"mount", test_mount, OPT_NOJIGTEST | OPT_NOALLTEST},
|
||||
{"param", test_param, 0},
|
||||
{"parameters", test_parameters, 0},
|
||||
{"perf", test_perf, OPT_NOJIGTEST},
|
||||
|
||||
Reference in New Issue
Block a user