From 1f92a1383add22bcd1ef40e901094be7d1dd96a0 Mon Sep 17 00:00:00 2001 From: "Pawel Spychalski (DzikuVx)" Date: Fri, 10 Apr 2020 20:30:55 +0200 Subject: [PATCH] Add new logic conditions and poll on Programming Tab --- js/fc.js | 34 ++++++++++++++++++++++++++++++++++ tabs/programming.js | 12 ++++++++++++ 2 files changed, 46 insertions(+) diff --git a/js/fc.js b/js/fc.js index 5d9718c1..9592d03b 100644 --- a/js/fc.js +++ b/js/fc.js @@ -1066,6 +1066,34 @@ var FC = { 13: { name: "STICKY", hasOperand: [true, true] + }, + 14: { + name: "ADD", + hasOperand: [true, true] + }, + 15: { + name: "SUB", + hasOperand: [true, true] + }, + 16: { + name: "MUL", + hasOperand: [true, true] + }, + 17: { + name: "DIV", + hasOperand: [true, true] + }, + 18: { + name: "GVAR SET", + hasOperand: [true, true] + }, + 19: { + name: "GVAR INC", + hasOperand: [true, true] + }, + 20: { + name: "GVAR DEC", + hasOperand: [true, true] } } }, @@ -1176,6 +1204,12 @@ var FC = { range: [0, 15], default: 0 }, + 5: { + name: "Global Variable", + type: "range", + range: [0, 3], + default: 0 + } } } }; diff --git a/tabs/programming.js b/tabs/programming.js index a5d04a1c..24556bd0 100644 --- a/tabs/programming.js +++ b/tabs/programming.js @@ -44,8 +44,20 @@ TABS.programming.initialize = function (callback, scrollPosition) { saveChainer.execute(); }); + if (semver.gte(CONFIG.flightControllerVersion, "2.3.0")) { + helper.mspBalancedInterval.add('logic_conditions_pull', 350, 1, getLogicConditionsStatus); + } + GUI.content_ready(callback); } + + function getLogicConditionsStatus() { + mspHelper.loadSensorStatus(onStatusPullDone); + } + + function onStatusPullDone() { + LOGIC_CONDITIONS.update(LOGIC_CONDITIONS_STATUS); + } } TABS.programming.cleanup = function (callback) {