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-04 12:33:31 -04:00
parent 45ebbb895a
commit 746a8f5cf9
96 changed files with 332 additions and 528 deletions
+2 -2
View File
@@ -104,7 +104,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
WORKING_DIRECTORY ${SITL_WORKING_DIR})
#set_tests_properties(shutdown PROPERTIES FAIL_REGULAR_EXPRESSION "shutdown FAILED")
set_tests_properties(shutdown PROPERTIES PASS_REGULAR_EXPRESSION "Shutting down")
set_tests_properties(shutdown PROPERTIES PASS_REGULAR_EXPRESSION "Exiting NOW.")
sanitizer_fail_test_on_error(shutdown)
endif()
@@ -145,7 +145,7 @@ foreach(cmd_name ${test_cmds})
WORKING_DIRECTORY ${SITL_WORKING_DIR})
sanitizer_fail_test_on_error(posix_${cmd_name})
set_tests_properties(posix_${cmd_name} PROPERTIES PASS_REGULAR_EXPRESSION "Shutting down")
set_tests_properties(posix_${cmd_name} PROPERTIES PASS_REGULAR_EXPRESSION "Exiting NOW.")
endforeach()
if(CMAKE_BUILD_TYPE STREQUAL Coverage)
-7
View File
@@ -111,13 +111,6 @@ static void *entry_adapter(void *ptr)
return nullptr;
}
void
px4_systemreset(bool to_bootloader)
{
PX4_WARN("Called px4_system_reset");
system_exit(0);
}
px4_task_t px4_task_spawn_cmd(const char *name, int scheduler, int priority, int stack_size, px4_main_t entry,
char *const argv[])
{