Skip to content

Commit 7bb5479

Browse files
update virtualFC version and accompanying modes for modes-tab (#4332)
* update virtualFC modes-tab * 1.47=4.6 * Update src/js/VirtualFC.js -- splice for 1.47 Co-authored-by: Mark Haslinghuis <[email protected]> * fixup semver and padding Co-authored-by: Mark Haslinghuis <[email protected]> * add 1.47 to drop-down * set virtual fc version to 4.6.0 * set virtual fc port_handler.js virtualMspVersion 1.47 * fixup import Co-authored-by: Mark Haslinghuis <[email protected]> * remove unsupported versions Co-authored-by: Mark Haslinghuis <[email protected]> --------- Co-authored-by: Mark Haslinghuis <[email protected]>
1 parent bf56d42 commit 7bb5479

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

src/components/port-picker/FirmwareVirtualOption.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ export default {
2121
data() {
2222
return {
2323
firmwareVersions: [
24+
{ value: "1.47.0", label: "MSP: 1.47 | Firmware: 4.6.*" },
2425
{ value: "1.46.0", label: "MSP: 1.46 | Firmware: 4.5.*" },
2526
{ value: "1.45.0", label: "MSP: 1.45 | Firmware: 4.4.*" },
2627
{ value: "1.44.0", label: "MSP: 1.44 | Firmware: 4.3.*" },
27-
{ value: "1.43.0", label: "MSP: 1.43 | Firmware: 4.2.*" },
28-
{ value: "1.42.0", label: "MSP: 1.42 | Firmware: 4.1.*" },
29-
{ value: "1.41.0", label: "MSP: 1.41 | Firmware: 4.0.*" },
3028
],
3129
};
3230
},

src/js/VirtualFC.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import Features from "./Features";
22
import { i18n } from "./localization";
33
import Beepers from "./Beepers";
44
import FC from "./fc";
5-
import CONFIGURATOR from "./data_storage";
5+
import CONFIGURATOR, { API_VERSION_1_47 } from "./data_storage";
66
import { OSD } from "./tabs/osd";
7+
import semver from "semver";
78

89
const VirtualFC = {
910
// these values are manufactured to unlock all the functionality of the configurator, they dont represent actual hardware
@@ -13,7 +14,7 @@ const VirtualFC = {
1314
virtualFC.resetState();
1415
virtualFC.CONFIG.deviceIdentifier = 0;
1516

16-
virtualFC.CONFIG.flightControllerVersion = "4.5.0";
17+
virtualFC.CONFIG.flightControllerVersion = "4.6.0";
1718
virtualFC.CONFIG.apiVersion = CONFIGURATOR.virtualApiVersion;
1819

1920
virtualFC.CONFIG.cpuTemp = 48;
@@ -221,9 +222,16 @@ const VirtualFC = {
221222
"READY",
222223
"LAP TIMER RESET",
223224
];
225+
226+
if (semver.gte(virtualFC.CONFIG.apiVersion, API_VERSION_1_47)) {
227+
virtualFC.AUX_CONFIG.splice(virtualFC.AUX_CONFIG.indexOf("HORIZON") + 1, 0, "ALT_HOLD");
228+
virtualFC.AUX_CONFIG.splice(virtualFC.AUX_CONFIG.indexOf("CAMSTAB") + 1, 0, "POS_HOLD");
229+
virtualFC.AUX_CONFIG.push("CHIRP");
230+
}
231+
224232
FC.AUX_CONFIG_IDS = [
225-
0, 1, 2, 4, 5, 6, 7, 8, 12, 13, 15, 17, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
226-
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
233+
0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 15, 17, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
234+
36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
227235
];
228236

229237
for (let i = 0; i < 16; i++) {

src/js/port_handler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const PortHandler = new (function () {
1616
selectedPort: DEFAULT_PORT,
1717
selectedBauds: DEFAULT_BAUDS,
1818
portOverride: getConfig("portOverride", "/dev/rfcomm0").portOverride,
19-
virtualMspVersion: "1.46.0",
19+
virtualMspVersion: "1.47.0",
2020
autoConnect: getConfig("autoConnect", false).autoConnect,
2121
};
2222

src/js/utils/common.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ export function checkChromeRuntimeError() {
4848
}
4949

5050
const majorFirmwareVersions = {
51+
1.47: "4.6.*",
5152
1.46: "4.5.*",
5253
1.45: "4.4.*",
5354
1.44: "4.3.*",
54-
1.43: "4.2.*",
55-
1.42: "4.1.*",
56-
1.41: "4.0.*",
5755
};
5856

5957
export function generateVirtualApiVersions() {

0 commit comments

Comments
 (0)