mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 19:40:22 +03:00
Drop MSP_STATUS and MSP_STATUS_EX
This commit is contained in:
parent
4426176c4b
commit
473adae418
5 changed files with 26 additions and 76 deletions
|
@ -107,7 +107,7 @@ var MSPCodes = {
|
||||||
MSP_RC_DEADBAND: 125,
|
MSP_RC_DEADBAND: 125,
|
||||||
MSP_SENSOR_ALIGNMENT: 126,
|
MSP_SENSOR_ALIGNMENT: 126,
|
||||||
MSP_LED_STRIP_MODECOLOR:127,
|
MSP_LED_STRIP_MODECOLOR:127,
|
||||||
MSP_STATUS_EX: 150,
|
MSP_STATUS_EX: 150, // Deprecated, do not use.
|
||||||
MSP_SENSOR_STATUS: 151,
|
MSP_SENSOR_STATUS: 151,
|
||||||
|
|
||||||
MSP_SET_RAW_RC: 200,
|
MSP_SET_RAW_RC: 200,
|
||||||
|
|
|
@ -68,27 +68,6 @@ var mspHelper = (function (gui) {
|
||||||
colorCount,
|
colorCount,
|
||||||
color;
|
color;
|
||||||
if (!dataHandler.unsupported || dataHandler.unsupported) switch (dataHandler.code) {
|
if (!dataHandler.unsupported || dataHandler.unsupported) switch (dataHandler.code) {
|
||||||
case MSPCodes.MSP_STATUS:
|
|
||||||
console.log('Using deprecated msp command: MSP_STATUS');
|
|
||||||
CONFIG.cycleTime = data.getUint16(0, true);
|
|
||||||
CONFIG.i2cError = data.getUint16(2, true);
|
|
||||||
CONFIG.activeSensors = data.getUint16(4, true);
|
|
||||||
CONFIG.mode = data.getUint32(6, true);
|
|
||||||
CONFIG.profile = data.getUint8(10);
|
|
||||||
gui.updateProfileChange();
|
|
||||||
gui.updateStatusBar();
|
|
||||||
break;
|
|
||||||
case MSPCodes.MSP_STATUS_EX:
|
|
||||||
CONFIG.cycleTime = data.getUint16(0, true);
|
|
||||||
CONFIG.i2cError = data.getUint16(2, true);
|
|
||||||
CONFIG.activeSensors = data.getUint16(4, true);
|
|
||||||
CONFIG.profile = data.getUint8(10);
|
|
||||||
CONFIG.cpuload = data.getUint16(11, true);
|
|
||||||
CONFIG.armingFlags = data.getUint16(13, true);
|
|
||||||
gui.updateStatusBar();
|
|
||||||
gui.updateProfileChange();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MSPCodes.MSPV2_INAV_STATUS:
|
case MSPCodes.MSPV2_INAV_STATUS:
|
||||||
CONFIG.cycleTime = data.getUint16(offset, true);
|
CONFIG.cycleTime = data.getUint16(offset, true);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
|
@ -2742,10 +2721,6 @@ var mspHelper = (function (gui) {
|
||||||
MSP.send_message(MSPCodes.MSP_PIDNAMES, false, false, callback);
|
MSP.send_message(MSPCodes.MSP_PIDNAMES, false, false, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.loadStatus = function (callback) {
|
|
||||||
MSP.send_message(MSPCodes.MSP_STATUS, false, false, callback);
|
|
||||||
};
|
|
||||||
|
|
||||||
self.loadFeatures = function (callback) {
|
self.loadFeatures = function (callback) {
|
||||||
MSP.send_message(MSPCodes.MSP_FEATURE, false, false, callback);
|
MSP.send_message(MSPCodes.MSP_FEATURE, false, false, callback);
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,7 +62,7 @@ $(document).ready(function () {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
helper.timeout.add('waiting_for_bootup', function waiting_for_bootup() {
|
helper.timeout.add('waiting_for_bootup', function waiting_for_bootup() {
|
||||||
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function () {
|
MSP.send_message(MSPCodes.MSPV2_INAV_STATUS, false, false, function () {
|
||||||
//noinspection JSUnresolvedVariable
|
//noinspection JSUnresolvedVariable
|
||||||
GUI.log(chrome.i18n.getMessage('deviceReady'));
|
GUI.log(chrome.i18n.getMessage('deviceReady'));
|
||||||
//noinspection JSValidateTypes
|
//noinspection JSValidateTypes
|
||||||
|
|
25
js/tasks.js
25
js/tasks.js
|
@ -1,25 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var helper = helper || {};
|
|
||||||
|
|
||||||
helper.task = (function () {
|
|
||||||
|
|
||||||
var publicScope = {},
|
|
||||||
privateScope = {};
|
|
||||||
|
|
||||||
privateScope.getStatusPullInterval = function () {
|
|
||||||
//TODO use serial connection speed to determine update interval
|
|
||||||
return 250;
|
|
||||||
};
|
|
||||||
|
|
||||||
publicScope.statusPullStart = function () {
|
|
||||||
helper.interval.add('status_pull', function () {
|
|
||||||
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function () {
|
|
||||||
MSP.send_message(MSPCodes.MSP_SENSOR_STATUS);
|
|
||||||
});
|
|
||||||
|
|
||||||
}, privateScope.getStatusPullInterval(), true);
|
|
||||||
};
|
|
||||||
|
|
||||||
return publicScope;
|
|
||||||
})();
|
|
|
@ -53,7 +53,7 @@ TABS.calibration.initialize = function (callback) {
|
||||||
googleAnalytics.sendAppView('Calibration');
|
googleAnalytics.sendAppView('Calibration');
|
||||||
}
|
}
|
||||||
loadChainer.setChain([
|
loadChainer.setChain([
|
||||||
mspHelper.loadStatus,
|
mspHelper.queryFcStatus,
|
||||||
mspHelper.loadSensorConfig,
|
mspHelper.loadSensorConfig,
|
||||||
mspHelper.loadCalibrationData
|
mspHelper.loadCalibrationData
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue