mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 17:13:34 +08:00
reboot: Add reboot to ISP option
This commit is contained in:
committed by
Daniel Agar
parent
8ba18a78af
commit
84093a07a2
@@ -187,7 +187,7 @@ static void mavlink_usb_check(void *arg)
|
||||
|
||||
if (param1 == 1) {
|
||||
// 1: Reboot autopilot
|
||||
px4_reboot_request(false, 0);
|
||||
px4_reboot_request(REBOOT_REQUEST, 0);
|
||||
|
||||
} else if (param1 == 2) {
|
||||
// 2: Shutdown autopilot
|
||||
@@ -197,7 +197,7 @@ static void mavlink_usb_check(void *arg)
|
||||
|
||||
} else if (param1 == 3) {
|
||||
// 3: Reboot autopilot and keep it in the bootloader until upgraded.
|
||||
px4_reboot_request(true, 0);
|
||||
px4_reboot_request(REBOOT_TO_BOOTLOADER, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform_common/shutdown.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <arm_internal.h>
|
||||
@@ -61,7 +62,7 @@ static int board_reset_enter_bootloader()
|
||||
|
||||
int board_reset(int status)
|
||||
{
|
||||
if (status == 1) {
|
||||
if (status == REBOOT_TO_BOOTLOADER) {
|
||||
board_reset_enter_bootloader();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform_common/shutdown.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/board.h>
|
||||
|
||||
@@ -72,7 +73,7 @@ static int board_reset_enter_bootloader()
|
||||
|
||||
int board_reset(int status)
|
||||
{
|
||||
if (status == 1) {
|
||||
if (status == REBOOT_TO_BOOTLOADER) {
|
||||
board_reset_enter_bootloader();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform_common/shutdown.h>
|
||||
#include <systemlib/px4_macros.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/board.h>
|
||||
@@ -96,7 +97,7 @@ int board_configure_reset(reset_mode_e mode, uint32_t arg)
|
||||
|
||||
int board_reset(int status)
|
||||
{
|
||||
if (status == 1) {
|
||||
if (status == REBOOT_TO_BOOTLOADER) {
|
||||
board_reset_enter_bootloader();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform_common/shutdown.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <hardware/s32k3xx_mc_me.h>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform_common/shutdown.h>
|
||||
#include <systemlib/px4_macros.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -119,7 +120,7 @@
|
||||
|
||||
int board_reset(int status)
|
||||
{
|
||||
if (status == 1) {
|
||||
if (status == REBOOT_TO_BOOTLOADER) {
|
||||
// board_configure_reset(BOARD_RESET_MODE_BOOT_TO_BL, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform_common/shutdown.h>
|
||||
#include <systemlib/px4_macros.h>
|
||||
#include <errno.h>
|
||||
#include <stm32_pwr.h>
|
||||
@@ -117,7 +118,7 @@ int board_configure_reset(reset_mode_e mode, uint32_t arg)
|
||||
|
||||
int board_reset(int status)
|
||||
{
|
||||
if (status == 1) {
|
||||
if (status == REBOOT_TO_BOOTLOADER) {
|
||||
board_configure_reset(BOARD_RESET_MODE_BOOT_TO_BL, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user