Merge pull request #2904 from klutvott123/reboot-options
Make "Activate bootloader" button use bootloader in flash if it exists10.8-maintenance 10.8.0-RC6
commit
be4a9e1ba0
|
@ -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,
|
||||||
|
|
|
@ -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 = {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue