From af11a8e5720f86365f8a3c679a32746b56612bc4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 May 2020 13:39:58 +1000 Subject: [PATCH] GCS_MAVLink: consider NO_CHANGE as success for bootloader flash this prevents GCS users from seeing "update failed" --- libraries/GCS_MAVLink/GCS_Common.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 36bf4b7f8c..8eb5e38df4 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -3328,11 +3328,16 @@ MAV_RESULT GCS_MAVLINK::handle_command_flash_bootloader(const mavlink_command_lo return MAV_RESULT_FAILED; } - if (!hal.util->flash_bootloader()) { - return MAV_RESULT_FAILED; + switch (hal.util->flash_bootloader()) { + case AP_HAL::Util::FlashBootloader::OK: + case AP_HAL::Util::FlashBootloader::NO_CHANGE: + // consider NO_CHANGE as success (so as not to display error to user) + return MAV_RESULT_ACCEPTED; + default: + break; } - return MAV_RESULT_ACCEPTED; + return MAV_RESULT_FAILED; } MAV_RESULT GCS_MAVLINK::handle_command_preflight_set_sensor_offsets(const mavlink_command_long_t &packet)