1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 08:15:22 +03:00

Added Virtual Mode

This commit is contained in:
visdauas 2020-12-28 17:24:34 +01:00
parent 09663e386e
commit 030a75a89e
15 changed files with 518 additions and 52 deletions

View file

@ -42,3 +42,34 @@ function bytesToSize(bytes) {
}
return false;
}
const majorFirmwareVersions = {
'1.43': '4.2.*',
'1.42': '4.1.*',
'1.41': '4.0.*',
'1.40': '3.5.*',
'1.39': '3.4.*',
'1.37': '3.3.0',
'1.36': '3.2.*',
'1.31': '3.1.0',
};
function generateVirtualApiVersions() {
const firmwareVersionDropdown = document.getElementById('firmware-version-dropdown');
const max = semver.minor(CONFIGURATOR.API_VERSION_MAX_SUPPORTED);
for (let i = max; i > 0; i--) {
const option = document.createElement("option");
const verNum = `1.${i}`;
option.value = `${verNum}.0`;
option.text = `MSP: ${verNum} `;
if (majorFirmwareVersions.hasOwnProperty(verNum)) {
option.text += ` | Firmware: ${majorFirmwareVersions[verNum]}`;
} else if (i === max) {
option.text += ` | Latest Firmware`;
}
firmwareVersionDropdown.appendChild(option);
}
}