From 441ce2e59347f19002a413701e6c1c6350fdb8be Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Tue, 16 Aug 2022 08:41:54 +0530 Subject: [PATCH] AP_HAL: add util method boot_to_dfu() --- libraries/AP_HAL/Util.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_HAL/Util.h b/libraries/AP_HAL/Util.h index f8241558e7..af81ef4633 100644 --- a/libraries/AP_HAL/Util.h +++ b/libraries/AP_HAL/Util.h @@ -81,6 +81,7 @@ public: int8_t scheduler_task; bool armed; // true if vehicle was armed enum safety_state safety_state; + bool boot_to_dfu; // true if we should reboot to DFU on boot }; struct PersistentData persistent_data; // last_persistent_data is only filled in if we've suffered a watchdog reset @@ -201,6 +202,9 @@ public: virtual void* last_crash_dump_ptr() const { return nullptr; } #endif +#if HAL_ENABLE_DFU_BOOT + virtual void boot_to_dfu(void) {} +#endif protected: // we start soft_armed false, so that actuators don't send any // values until the vehicle code has fully started