Merge pull request #2904 from klutvott123/reboot-options

Make "Activate bootloader" button use bootloader in flash if it exists
10.8-maintenance 10.8.0-RC6
haslinghuis 2022-04-24 04:09:23 +02:00 committed by GitHub
commit be4a9e1ba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -824,6 +824,15 @@ const FC = {
return hasVcp; 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: { FILTER_TYPE_FLAGS: {
PT1: 0, PT1: 0,
BIQUAD: 1, BIQUAD: 1,

View File

@ -40,6 +40,7 @@ function MspHelper() {
BOOTLOADER: 1, BOOTLOADER: 1,
MSC: 2, MSC: 2,
MSC_UTC: 3, MSC_UTC: 3,
BOOTLOADER_FLASH: 4,
}; };
self.RESET_TYPES = { self.RESET_TYPES = {

View File

@ -93,7 +93,7 @@ TABS.setup.initialize = function (callback) {
$('a.rebootBootloader').click(function () { $('a.rebootBootloader').click(function () {
const buffer = []; 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); MSP.send_message(MSPCodes.MSP_SET_REBOOT, buffer, false);
}); });
} else { } else {