From ddc1fa61855efa75f73d91e5b72a41fecc96397a Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sat, 23 Mar 2019 09:07:43 -0700 Subject: [PATCH] ArduPilot: Flash bootloader support --- src/Vehicle/Vehicle.cc | 13 +++++++++++++ src/Vehicle/Vehicle.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 9f540b7fc..64eadc702 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -3849,6 +3849,19 @@ int Vehicle::versionCompare(int major, int minor, int patch) return _firmwarePlugin->versionCompare(this, major, minor, patch); } +#if !defined(NO_ARDUPILOT_DIALECT) +void Vehicle::flashBootloader(void) +{ + sendMavCommand(defaultComponentId(), + MAV_CMD_FLASH_BOOTLOADER, + true, // show error + 0, 0, 0, 0, // param 1-4 not used + 290876); // magic number + +} +#endif + + //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index cba6240ea..530a4ed13 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -756,6 +756,10 @@ public: /// @param percent 0-no power, 100-full power Q_INVOKABLE void motorTest(int motor, int percent); +#if !defined(NO_ARDUPILOT_DIALECT) + Q_INVOKABLE void flashBootloader(void); +#endif + bool guidedModeSupported (void) const; bool pauseVehicleSupported (void) const; bool orbitModeSupported (void) const; -- 2.22.0