mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-23 00:05:19 +03:00
Add MSP2_INAV_LOGIC_CONDITIONS_SINGLE
This commit is contained in:
parent
ab7162980b
commit
86337d5aa2
3 changed files with 36 additions and 34 deletions
|
@ -229,5 +229,7 @@ var MSPCodes = {
|
|||
MSP2_INAV_FWUPDT_ROLLBACK_EXEC: 0x2037,
|
||||
|
||||
MSP2_INAV_SAFEHOME: 0x2038,
|
||||
MSP2_INAV_SET_SAFEHOME: 0x2039
|
||||
MSP2_INAV_SET_SAFEHOME: 0x2039,
|
||||
|
||||
MSP2_INAV_LOGIC_CONDITIONS_SINGLE: 0x203B
|
||||
};
|
||||
|
|
|
@ -463,18 +463,7 @@ var mspHelper = (function (gui) {
|
|||
console.log("Servo mix saved");
|
||||
break;
|
||||
case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS:
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "5.0.0")) {
|
||||
LOGIC_CONDITIONS.put(new LogicCondition(
|
||||
data.getInt8(0),
|
||||
data.getInt8(1),
|
||||
data.getUint8(2),
|
||||
data.getUint8(3),
|
||||
data.getInt32(4, true),
|
||||
data.getUint8(8),
|
||||
data.getInt32(9, true),
|
||||
data.getInt8(13)
|
||||
));
|
||||
} else {
|
||||
LOGIC_CONDITIONS.flush();
|
||||
if (data.byteLength % 14 === 0) {
|
||||
for (i = 0; i < data.byteLength; i += 14) {
|
||||
LOGIC_CONDITIONS.put(new LogicCondition(
|
||||
|
@ -489,7 +478,19 @@ var mspHelper = (function (gui) {
|
|||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE:
|
||||
LOGIC_CONDITIONS.put(new LogicCondition(
|
||||
data.getInt8(0),
|
||||
data.getInt8(1),
|
||||
data.getUint8(2),
|
||||
data.getUint8(3),
|
||||
data.getInt32(4, true),
|
||||
data.getUint8(8),
|
||||
data.getInt32(9, true),
|
||||
data.getInt8(13)
|
||||
));
|
||||
break;
|
||||
|
||||
case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_STATUS:
|
||||
|
@ -2270,18 +2271,17 @@ var mspHelper = (function (gui) {
|
|||
};
|
||||
|
||||
self.loadLogicConditions = function (callback) {
|
||||
LOGIC_CONDITIONS.flush();
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "5.0.0")) {
|
||||
LOGIC_CONDITIONS.flush();
|
||||
let idx = 0;
|
||||
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS, [idx], false, nextLogicCondition);
|
||||
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE, [idx], false, nextLogicCondition);
|
||||
|
||||
function nextLogicCondition() {
|
||||
idx++;
|
||||
if (idx < LOGIC_CONDITIONS.getMaxLogicConditionCount() - 1) {
|
||||
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS, [idx], false, nextLogicCondition);
|
||||
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE, [idx], false, nextLogicCondition);
|
||||
} else {
|
||||
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS, [idx], false, callback);
|
||||
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE, [idx], false, callback);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
"jquery-ui-npm": "1.12.0",
|
||||
"marked": "^0.3.17",
|
||||
"minimist": "^1.2.0",
|
||||
"nw": "^0.61.0-sdk",
|
||||
"nw": "^0.61.0",
|
||||
"nw-dialog": "^1.0.7",
|
||||
"openlayers": "^4.6.5",
|
||||
"plotly": "^1.0.6",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue