diff --git a/src/js/fc.js b/src/js/fc.js index 2c35af3248..0319d37790 100644 --- a/src/js/fc.js +++ b/src/js/fc.js @@ -824,6 +824,15 @@ const FC = { return hasVcp; }, + boardHasFlashBootloader() { + let hasFlashBootloader = false; + if (semver.gte(this.CONFIG.apiVersion, API_VERSION_1_42)) { + hasFlashBootloader = bit_check(this.CONFIG.targetCapabilities, this.TARGET_CAPABILITIES_FLAGS.HAS_FLASH_BOOTLOADER); + } + + return hasFlashBootloader; + }, + FILTER_TYPE_FLAGS: { PT1: 0, BIQUAD: 1, diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index 86d40997ec..89c3686cb0 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -40,6 +40,7 @@ function MspHelper() { BOOTLOADER: 1, MSC: 2, MSC_UTC: 3, + BOOTLOADER_FLASH: 4, }; self.RESET_TYPES = { diff --git a/src/js/tabs/setup.js b/src/js/tabs/setup.js index ba694f34a4..ab29a51632 100644 --- a/src/js/tabs/setup.js +++ b/src/js/tabs/setup.js @@ -93,7 +93,7 @@ TABS.setup.initialize = function (callback) { $('a.rebootBootloader').click(function () { const buffer = []; - buffer.push(mspHelper.REBOOT_TYPES.BOOTLOADER); + buffer.push(FC.boardHasFlashBootloader() ? mspHelper.REBOOT_TYPES.BOOTLOADER_FLASH : mspHelper.REBOOT_TYPES.BOOTLOADER); MSP.send_message(MSPCodes.MSP_SET_REBOOT, buffer, false); }); } else {