1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-14 11:59:53 +03:00

Restore experimental backup and restore only for virtual and fw below 4.3 (#3134)

Restore backup and restore
This commit is contained in:
haslinghuis 2022-12-11 23:22:12 +01:00 committed by GitHub
parent 867b59d204
commit c625741604
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 1469 additions and 688 deletions

View file

@ -44,25 +44,18 @@ class EscProtocols
EscProtocols.PROTOCOL_ONESHOT125,
EscProtocols.PROTOCOL_ONESHOT42,
EscProtocols.PROTOCOL_MULTISHOT,
EscProtocols.PROTOCOL_BRUSHED,
EscProtocols.PROTOCOL_DSHOT150,
EscProtocols.PROTOCOL_DSHOT300,
EscProtocols.PROTOCOL_DSHOT600,
];
if (semver.gte(apiVersion, "1.20.0")) {
escProtocols.push(EscProtocols.PROTOCOL_BRUSHED);
if (semver.lt(apiVersion, API_VERSION_1_42)) {
escProtocols.push(EscProtocols.PROTOCOL_DSHOT1200);
}
if (semver.gte(apiVersion, API_VERSION_1_31)) {
escProtocols.push(EscProtocols.PROTOCOL_DSHOT150);
escProtocols.push(EscProtocols.PROTOCOL_DSHOT300);
escProtocols.push(EscProtocols.PROTOCOL_DSHOT600);
if (semver.lt(apiVersion, API_VERSION_1_42)) {
escProtocols.push(EscProtocols.PROTOCOL_DSHOT1200);
}
}
if (semver.gte(apiVersion, API_VERSION_1_36)) {
escProtocols.push(EscProtocols.PROTOCOL_PROSHOT1000);
}
escProtocols.push(EscProtocols.PROTOCOL_PROSHOT1000);
if (semver.gte(apiVersion, API_VERSION_1_43)) {
escProtocols.push(EscProtocols.PROTOCOL_DISABLED);
@ -73,22 +66,7 @@ class EscProtocols
static ReorderPwmProtocols(apiVersion, protocolIndex)
{
let result = protocolIndex;
if (semver.lt(apiVersion, "1.26.0")) {
switch (protocolIndex) {
case 5:
result = 7;
break;
case 7:
result = 5;
break;
default:
break;
}
}
return result;
return protocolIndex;
}