1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 01:35:28 +03:00

Make "Activate bootloader" button use bootloader in flash if it exists

This commit is contained in:
Hans Christian Olaussen 2022-04-24 00:11:46 +02:00
parent b98e042f4d
commit 145d567ff9
3 changed files with 11 additions and 1 deletions

View file

@ -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,

View file

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

View file

@ -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 {