Fix flight mode trim disabled

This commit is contained in:
Raphael Coeffic
2022-01-16 10:38:52 +01:00
parent 82aa94848e
commit 8071807584
@@ -369,7 +369,7 @@ struct convert<YamlTrim> {
Node node; Node node;
node["value"] = rhs.value; node["value"] = rhs.value;
if (rhs.mode < 0) { if (rhs.mode < 0) {
node["mode"] = -1; node["mode"] = (1 << 5) - 1;
} else { } else {
node["mode"] = 2 * rhs.ref + rhs.mode; node["mode"] = 2 * rhs.ref + rhs.mode;
} }
@@ -381,8 +381,8 @@ struct convert<YamlTrim> {
int trimMode = 0; int trimMode = 0;
node["mode"] >> trimMode; node["mode"] >> trimMode;
if (trimMode < 0) { if (trimMode == (1 << 5) - 1) {
rhs.mode = trimMode; rhs.mode = -1;
} else { } else {
rhs.mode = trimMode % 2; rhs.mode = trimMode % 2;
rhs.ref = trimMode / 2; rhs.ref = trimMode / 2;