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
-1
View File
@@ -74,7 +74,6 @@ px4_add_board(
param
perf
pwm
reboot
sd_bench
shutdown
tests # tests and test runner
@@ -44,9 +44,6 @@
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_HAS_NO_RESET
#define BOARD_HAS_NO_BOOTLOADER
#define BOARD_MAX_LEDS 1 // Number of external LED's this board has
#define PX4_NUMBER_I2C_BUSES 4
-1
View File
@@ -99,7 +99,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-3
View File
@@ -93,9 +93,6 @@ extern void led_on(int led);
extern void led_off(int led);
__END_DECLS
/****************************************************************************
* Protected Functions
****************************************************************************/
/************************************************************************************
* Name: board_on_reset
*
-1
View File
@@ -101,7 +101,6 @@ px4_add_board(
param
perf
pwm
reboot
sd_bench
shutdown
#tests # tests and test runner
@@ -42,9 +42,6 @@
#define BOARD_OVERRIDE_UUID "EAGLEID000000000" // must be of length 16
#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_EAGLE
#define BOARD_HAS_NO_RESET
#define BOARD_HAS_NO_BOOTLOADER
/*
* I2C busses
*/
-1
View File
@@ -100,7 +100,6 @@ px4_add_board(
param
perf
pwm
reboot
sd_bench
shutdown
#tests # tests and test runner
@@ -42,9 +42,6 @@
#define BOARD_OVERRIDE_UUID "EAGLEID000000000" // must be of length 16
#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_EAGLE
#define BOARD_HAS_NO_RESET
#define BOARD_HAS_NO_BOOTLOADER
/*
* I2C busses
*/
-1
View File
@@ -98,7 +98,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -70,7 +70,6 @@ px4_add_board(
param
perf
pwm
reboot
sd_bench
shutdown
tests # tests and test runner
@@ -44,8 +44,6 @@
#define BOARD_BATTERY1_V_DIV (11.0f)
#define BOARD_HAS_NO_BOOTLOADER
#define BOARD_MAX_LEDS 4 // Number external of LED's this board has
-1
View File
@@ -53,7 +53,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
top
topic_listener
tune_control
-1
View File
@@ -103,7 +103,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
+2
View File
@@ -49,6 +49,8 @@
extern int sercon_main(int c, char **argv);
__EXPORT void board_on_reset(int status) {}
__EXPORT void stm32_boardinitialize(void)
{
/* configure USB interfaces */
-1
View File
@@ -70,7 +70,6 @@ px4_add_board(
param
perf
pwm
reboot
sd_bench
shutdown
tests # tests and test runner
-3
View File
@@ -45,9 +45,6 @@
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
#define BOARD_HAS_NO_RESET
#define BOARD_HAS_NO_BOOTLOADER
#define BOARD_MAX_LEDS 1 // Number of external LED's this board has
-1
View File
@@ -103,7 +103,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
@@ -60,7 +60,6 @@ CONFIG_MM_REGIONS=3
CONFIG_NFILE_DESCRIPTORS=5
CONFIG_NFILE_STREAMS=3
CONFIG_NPTHREAD_KEYS=4
CONFIG_PREALLOC_TIMERS=50
CONFIG_PREALLOC_WDOGS=50
CONFIG_PTHREAD_STACK_MIN=512
@@ -92,7 +91,6 @@ CONFIG_TIME_EXTENDED=y
CONFIG_TTY_SIGINT=y
CONFIG_TTY_SIGINT_CHAR=0x03
CONFIG_TTY_SIGSTP=y
CONFIG_USART3_DMA=y
CONFIG_USART3_RXBUFSIZE=600
CONFIG_USART3_TXBUFSIZE=300
CONFIG_USBDEV=y
@@ -34,22 +34,12 @@
/**
* @file bootloader_main.c
*
* PX4FMU-specific early startup code for bootloader
* FMU-specific early startup code for bootloader
*/
/****************************************************************************
* Included Files
****************************************************************************/
#include "board_config.h"
#include "bl.h"
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/config.h>
#include <nuttx/board.h>
#include <chip.h>
@@ -59,14 +49,11 @@
extern int sercon_main(int c, char **argv);
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
__EXPORT void
stm32_boardinitialize(void)
__EXPORT void board_on_reset(int status) {}
__EXPORT void stm32_boardinitialize(void)
{
/* configure USB interfaces */
stm32_usbinitialize();
}
@@ -104,7 +104,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -67,7 +67,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
top
topic_listener
tune_control
-1
View File
@@ -79,7 +79,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
#tests # tests and test runner
top
#topic_listener
-1
View File
@@ -79,7 +79,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
#tests # tests and test runner
top
#topic_listener
-1
View File
@@ -97,7 +97,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -103,7 +103,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -98,7 +98,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -101,7 +101,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -98,7 +98,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -98,7 +98,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -91,7 +91,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
top
topic_listener
tune_control
@@ -66,7 +66,6 @@ px4_add_board(
reboot
#reflect
#sd_bench
shutdown
top
#topic_listener
#tune_control
-1
View File
@@ -87,7 +87,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
#tests # tests and test runner
top
#topic_listener
-1
View File
@@ -111,7 +111,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -110,7 +110,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -105,7 +105,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -105,7 +105,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -104,7 +104,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -104,7 +104,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -104,7 +104,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -105,7 +105,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -104,7 +104,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -107,7 +107,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -109,7 +109,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -82,7 +82,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
top
topic_listener
tune_control
-1
View File
@@ -108,7 +108,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -93,7 +93,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
top
topic_listener
tune_control
-1
View File
@@ -103,7 +103,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -82,7 +82,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
top
topic_listener
tune_control
-1
View File
@@ -108,7 +108,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener
-1
View File
@@ -109,7 +109,6 @@ px4_add_board(
reboot
reflect
sd_bench
shutdown
tests # tests and test runner
top
topic_listener

Some files were not shown because too many files have changed in this diff Show More