mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 19:40:22 +03:00
Add support for MSP_SENSOR_STATUS if firmware version is gte 1.5
This commit is contained in:
parent
c631b33fda
commit
2946004ccf
16 changed files with 153 additions and 63 deletions
13
js/fc.js
13
js/fc.js
|
@ -41,6 +41,7 @@ var ADVANCED_CONFIG;
|
||||||
var INAV_PID_CONFIG;
|
var INAV_PID_CONFIG;
|
||||||
var PID_ADVANCED;
|
var PID_ADVANCED;
|
||||||
var FILTER_CONFIG;
|
var FILTER_CONFIG;
|
||||||
|
var SENSOR_STATUS;
|
||||||
|
|
||||||
var FC = {
|
var FC = {
|
||||||
isRatesInDps: function () {
|
isRatesInDps: function () {
|
||||||
|
@ -51,6 +52,18 @@ var FC = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetState: function() {
|
resetState: function() {
|
||||||
|
SENSOR_STATUS = {
|
||||||
|
isHardwareHealthy: 0,
|
||||||
|
gyroHwStatus: 0,
|
||||||
|
accHwStatus: 0,
|
||||||
|
magHwStatus: 0,
|
||||||
|
baroHwStatus: 0,
|
||||||
|
gpsHwStatus: 0,
|
||||||
|
rangeHwStatus: 0,
|
||||||
|
speedHwStatus: 0,
|
||||||
|
flowHwStatus: 0,
|
||||||
|
};
|
||||||
|
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
apiVersion: "0.0.0",
|
apiVersion: "0.0.0",
|
||||||
flightControllerIdentifier: '',
|
flightControllerIdentifier: '',
|
||||||
|
|
28
js/msp.js
28
js/msp.js
|
@ -80,6 +80,7 @@ var MSP_codes = {
|
||||||
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,
|
||||||
|
MSP_SENSOR_STATUS: 151,
|
||||||
|
|
||||||
MSP_SET_RAW_RC: 200,
|
MSP_SET_RAW_RC: 200,
|
||||||
MSP_SET_RAW_GPS: 201,
|
MSP_SET_RAW_GPS: 201,
|
||||||
|
@ -269,6 +270,7 @@ var MSP = {
|
||||||
CONFIG.msp_version = data.getUint8(2);
|
CONFIG.msp_version = data.getUint8(2);
|
||||||
CONFIG.capability = data.getUint32(3, 1);
|
CONFIG.capability = data.getUint32(3, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_codes.MSP_STATUS:
|
case MSP_codes.MSP_STATUS:
|
||||||
CONFIG.cycleTime = data.getUint16(0, 1);
|
CONFIG.cycleTime = data.getUint16(0, 1);
|
||||||
CONFIG.i2cError = data.getUint16(2, 1);
|
CONFIG.i2cError = data.getUint16(2, 1);
|
||||||
|
@ -277,10 +279,15 @@ var MSP = {
|
||||||
CONFIG.profile = data.getUint8(10);
|
CONFIG.profile = data.getUint8(10);
|
||||||
$('select[name="profilechange"]').val(CONFIG.profile);
|
$('select[name="profilechange"]').val(CONFIG.profile);
|
||||||
|
|
||||||
sensor_status(CONFIG.activeSensors);
|
// Only update sensors via MSP_STATUS if earlier than 1.5
|
||||||
|
if (semver.lt(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
sensor_status(CONFIG.activeSensors);
|
||||||
|
}
|
||||||
|
|
||||||
$('span.i2c-error').text(CONFIG.i2cError);
|
$('span.i2c-error').text(CONFIG.i2cError);
|
||||||
$('span.cycle-time').text(CONFIG.cycleTime);
|
$('span.cycle-time').text(CONFIG.cycleTime);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_codes.MSP_STATUS_EX:
|
case MSP_codes.MSP_STATUS_EX:
|
||||||
CONFIG.cycleTime = data.getUint16(0, 1);
|
CONFIG.cycleTime = data.getUint16(0, 1);
|
||||||
CONFIG.i2cError = data.getUint16(2, 1);
|
CONFIG.i2cError = data.getUint16(2, 1);
|
||||||
|
@ -289,12 +296,29 @@ var MSP = {
|
||||||
CONFIG.profile = data.getUint8(10);
|
CONFIG.profile = data.getUint8(10);
|
||||||
CONFIG.cpuload = data.getUint16(11, 1);
|
CONFIG.cpuload = data.getUint16(11, 1);
|
||||||
|
|
||||||
sensor_status(CONFIG.activeSensors);
|
// Only update sensors via MSP_STATUS if earlier than 1.5
|
||||||
|
if (semver.lt(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
sensor_status(CONFIG.activeSensors);
|
||||||
|
}
|
||||||
|
|
||||||
$('span.i2c-error').text(CONFIG.i2cError);
|
$('span.i2c-error').text(CONFIG.i2cError);
|
||||||
$('span.cycle-time').text(CONFIG.cycleTime);
|
$('span.cycle-time').text(CONFIG.cycleTime);
|
||||||
$('span.cpu-load').text(chrome.i18n.getMessage('statusbar_cpu_load', [CONFIG.cpuload]));
|
$('span.cpu-load').text(chrome.i18n.getMessage('statusbar_cpu_load', [CONFIG.cpuload]));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MSP_codes.MSP_SENSOR_STATUS:
|
||||||
|
SENSOR_STATUS.isHardwareHealthy = data.getUint8(0);
|
||||||
|
SENSOR_STATUS.gyroHwStatus = data.getUint8(1);
|
||||||
|
SENSOR_STATUS.accHwStatus = data.getUint8(2);
|
||||||
|
SENSOR_STATUS.magHwStatus = data.getUint8(3);
|
||||||
|
SENSOR_STATUS.baroHwStatus = data.getUint8(4);
|
||||||
|
SENSOR_STATUS.gpsHwStatus = data.getUint8(5);
|
||||||
|
SENSOR_STATUS.rangeHwStatus = data.getUint8(6);
|
||||||
|
SENSOR_STATUS.speedHwStatus = data.getUint8(7);
|
||||||
|
SENSOR_STATUS.flowHwStatus = data.getUint8(8);
|
||||||
|
sensor_status_ex(SENSOR_STATUS);
|
||||||
|
break;
|
||||||
|
|
||||||
case MSP_codes.MSP_RAW_IMU:
|
case MSP_codes.MSP_RAW_IMU:
|
||||||
// 512 for mpu6050, 256 for mma
|
// 512 for mpu6050, 256 for mma
|
||||||
// currently we are unable to differentiate between the sensor types, so we are goign with 512
|
// currently we are unable to differentiate between the sensor types, so we are goign with 512
|
||||||
|
|
|
@ -305,78 +305,72 @@ function read_serial(info) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sensor_status(sensors_detected) {
|
function sensor_status_ex(hw_status)
|
||||||
// initialize variable (if it wasn't)
|
{
|
||||||
if (!sensor_status.previous_sensors_detected) {
|
var statusHash = sensor_status_hash(hw_status);
|
||||||
sensor_status.previous_sensors_detected = -1; // Otherwise first iteration will not be run if sensors_detected == 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// update UI (if necessary)
|
if (sensor_status_ex.previousHash == statusHash) {
|
||||||
if (sensor_status.previous_sensors_detected == sensors_detected) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set current value
|
sensor_status_ex.previousHash = statusHash;
|
||||||
sensor_status.previous_sensors_detected = sensors_detected;
|
|
||||||
|
|
||||||
|
sensor_status_update_icon('.gyro', '.gyroicon', hw_status.gyroHwStatus);
|
||||||
|
sensor_status_update_icon('.accel', '.accicon', hw_status.accHwStatus);
|
||||||
|
sensor_status_update_icon('.mag', '.magicon', hw_status.magHwStatus);
|
||||||
|
sensor_status_update_icon('.baro', '.baroicon', hw_status.baroHwStatus);
|
||||||
|
sensor_status_update_icon('.gps', '.gpsicon', hw_status.gpsHwStatus);
|
||||||
|
sensor_status_update_icon('.sonar', '.sonaricon', hw_status.rangeHwStatus);
|
||||||
|
sensor_status_update_icon('.airspeed', '.airspeedicon', hw_status.speedHwStatus);
|
||||||
|
sensor_status_update_icon('.opflow', '.opflowicon', hw_status.flowHwStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sensor_status_update_icon(sensId, sensIconId, status)
|
||||||
|
{
|
||||||
var e_sensor_status = $('#sensor-status');
|
var e_sensor_status = $('#sensor-status');
|
||||||
|
|
||||||
if (have_sensor(sensors_detected, 'acc')) {
|
if (status == 0) {
|
||||||
$('.accel', e_sensor_status).addClass('on');
|
$(sensId, e_sensor_status).removeClass('on');
|
||||||
$('.accicon', e_sensor_status).addClass('active');
|
$(sensIconId, e_sensor_status).removeClass('active');
|
||||||
|
$(sensIconId, e_sensor_status).removeClass('error');
|
||||||
} else {
|
|
||||||
$('.accel', e_sensor_status).removeClass('on');
|
|
||||||
$('.accicon', e_sensor_status).removeClass('active');
|
|
||||||
}
|
}
|
||||||
|
else if (status == 1) {
|
||||||
if (have_sensor(sensors_detected, 'gyro')) {
|
$(sensId, e_sensor_status).addClass('on');
|
||||||
$('.gyro', e_sensor_status).addClass('on');
|
$(sensIconId, e_sensor_status).addClass('active');
|
||||||
$('.gyroicon', e_sensor_status).addClass('active');
|
$(sensIconId, e_sensor_status).removeClass('error');
|
||||||
} else {
|
|
||||||
$('.gyro', e_sensor_status).removeClass('on');
|
|
||||||
$('.gyroicon', e_sensor_status).removeClass('active');
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
if (have_sensor(sensors_detected, 'baro')) {
|
$(sensId, e_sensor_status).removeClass('on');
|
||||||
$('.baro', e_sensor_status).addClass('on');
|
$(sensIconId, e_sensor_status).removeClass('active');
|
||||||
$('.baroicon', e_sensor_status).addClass('active');
|
$(sensIconId, e_sensor_status).addClass('error');
|
||||||
} else {
|
|
||||||
$('.baro', e_sensor_status).removeClass('on');
|
|
||||||
$('.baroicon', e_sensor_status).removeClass('active');
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (have_sensor(sensors_detected, 'mag')) {
|
function sensor_status_hash(hw_status)
|
||||||
$('.mag', e_sensor_status).addClass('on');
|
{
|
||||||
$('.magicon', e_sensor_status).addClass('active');
|
return "S" +
|
||||||
} else {
|
hw_status.isHardwareHealthy +
|
||||||
$('.mag', e_sensor_status).removeClass('on');
|
hw_status.gyroHwStatus +
|
||||||
$('.magicon', e_sensor_status).removeClass('active');
|
hw_status.accHwStatus +
|
||||||
}
|
hw_status.magHwStatus +
|
||||||
|
hw_status.baroHwStatus +
|
||||||
|
hw_status.gpsHwStatus +
|
||||||
|
hw_status.rangeHwStatus +
|
||||||
|
hw_status.speedHwStatus +
|
||||||
|
hw_status.flowHwStatus;
|
||||||
|
}
|
||||||
|
|
||||||
if (have_sensor(sensors_detected, 'gps')) {
|
function sensor_status(sensors_detected) {
|
||||||
$('.gps', e_sensor_status).addClass('on');
|
SENSOR_STATUS.isHardwareHealthy = 1;
|
||||||
$('.gpsicon', e_sensor_status).addClass('active');
|
SENSOR_STATUS.gyroHwStatus = have_sensor(sensors_detected, 'gyro') ? 1 : 0;
|
||||||
} else {
|
SENSOR_STATUS.accHwStatus = have_sensor(sensors_detected, 'acc') ? 1 : 0;
|
||||||
$('.gps', e_sensor_status).removeClass('on');
|
SENSOR_STATUS.magHwStatus = have_sensor(sensors_detected, 'mag') ? 1 : 0;
|
||||||
$('.gpsicon', e_sensor_status).removeClass('active');
|
SENSOR_STATUS.baroHwStatus = have_sensor(sensors_detected, 'baro') ? 1 : 0;
|
||||||
}
|
SENSOR_STATUS.gpsHwStatus = have_sensor(sensors_detected, 'gps') ? 1 : 0;
|
||||||
|
SENSOR_STATUS.rangeHwStatus = have_sensor(sensors_detected, 'sonar') ? 1 : 0;
|
||||||
if (have_sensor(sensors_detected, 'sonar')) {
|
SENSOR_STATUS.speedHwStatus = have_sensor(sensors_detected, 'airspeed') ? 1 : 0;
|
||||||
$('.sonar', e_sensor_status).addClass('on');
|
SENSOR_STATUS.flowHwStatus = have_sensor(sensors_detected, 'opflow') ? 1 : 0;
|
||||||
$('.sonaricon', e_sensor_status).addClass('active');
|
sensor_status_ex(SENSOR_STATUS);
|
||||||
} else {
|
|
||||||
$('.sonar', e_sensor_status).removeClass('on');
|
|
||||||
$('.sonaricon', e_sensor_status).removeClass('active');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (have_sensor(sensors_detected, 'opflow')) {
|
|
||||||
$('.opflow', e_sensor_status).addClass('on');
|
|
||||||
$('.opflowicon', e_sensor_status).addClass('active');
|
|
||||||
} else {
|
|
||||||
$('.opflow', e_sensor_status).removeClass('on');
|
|
||||||
$('.opflowicon', e_sensor_status).removeClass('active');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function have_sensor(sensors_detected, sensor_code) {
|
function have_sensor(sensors_detected, sensor_code) {
|
||||||
|
@ -394,6 +388,8 @@ function have_sensor(sensors_detected, sensor_code) {
|
||||||
return bit_check(sensors_detected, 4);
|
return bit_check(sensors_detected, 4);
|
||||||
case 'opflow':
|
case 'opflow':
|
||||||
return bit_check(sensors_detected, 5);
|
return bit_check(sensors_detected, 5);
|
||||||
|
case 'airspeed':
|
||||||
|
return bit_check(sensors_detected, 6);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,6 +280,10 @@ TABS.adjustments.initialize = function (callback) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function () {
|
GUI.interval_add('status_pull', function () {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
|
@ -293,6 +293,10 @@ TABS.auxiliary.initialize = function (callback) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function () {
|
GUI.interval_add('status_pull', function () {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
|
@ -813,6 +813,10 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function status_pull() {
|
GUI.interval_add('status_pull', function status_pull() {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
GUI.interval_add('config_load_analog', load_analog, 250, true); // 4 fps
|
GUI.interval_add('config_load_analog', load_analog, 250, true); // 4 fps
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
|
@ -375,6 +375,10 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function status_pull() {
|
GUI.interval_add('status_pull', function status_pull() {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
|
@ -114,6 +114,10 @@ TABS.gps.initialize = function (callback) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function status_pull() {
|
GUI.interval_add('status_pull', function status_pull() {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -147,6 +147,10 @@ TABS.modes.initialize = function (callback) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function status_pull() {
|
GUI.interval_add('status_pull', function status_pull() {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
|
@ -456,7 +456,16 @@ TABS.motors.initialize = function (callback) {
|
||||||
|
|
||||||
function get_status() {
|
function get_status() {
|
||||||
// status needed for arming flag
|
// status needed for arming flag
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_motor_data);
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_sensor_status);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_motor_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_sensor_status() {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS, false, false, get_motor_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_motor_data() {
|
function get_motor_data() {
|
||||||
|
|
|
@ -222,6 +222,10 @@ TABS.ports.initialize = function (callback, scrollPosition) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function status_pull() {
|
GUI.interval_add('status_pull', function status_pull() {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
|
@ -486,6 +486,10 @@ TABS.receiver.initialize = function (callback) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function status_pull() {
|
GUI.interval_add('status_pull', function status_pull() {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
|
@ -446,6 +446,10 @@ TABS.sensors.initialize = function (callback) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function status_pull() {
|
GUI.interval_add('status_pull', function status_pull() {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
|
@ -190,6 +190,10 @@ TABS.servos.initialize = function (callback) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function () {
|
GUI.interval_add('status_pull', function () {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
|
@ -172,6 +172,10 @@ TABS.setup.initialize = function (callback) {
|
||||||
function get_slow_data() {
|
function get_slow_data() {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
|
|
||||||
MSP.send_message(MSP_codes.MSP_ANALOG, false, false, function () {
|
MSP.send_message(MSP_codes.MSP_ANALOG, false, false, function () {
|
||||||
bat_voltage_e.text(chrome.i18n.getMessage('initialSetupBatteryValue', [ANALOG.voltage]));
|
bat_voltage_e.text(chrome.i18n.getMessage('initialSetupBatteryValue', [ANALOG.voltage]));
|
||||||
bat_mah_drawn_e.text(chrome.i18n.getMessage('initialSetupBatteryMahValue', [ANALOG.mAhdrawn]));
|
bat_mah_drawn_e.text(chrome.i18n.getMessage('initialSetupBatteryMahValue', [ANALOG.mAhdrawn]));
|
||||||
|
|
|
@ -94,6 +94,10 @@ TABS.transponder.initialize = function (callback, scrollPosition) {
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
GUI.interval_add('status_pull', function status_pull() {
|
GUI.interval_add('status_pull', function status_pull() {
|
||||||
MSP.send_message(MSP_codes.MSP_STATUS);
|
MSP.send_message(MSP_codes.MSP_STATUS);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SENSOR_STATUS);
|
||||||
|
}
|
||||||
}, 250, true);
|
}, 250, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue