changes to support MSP API 1.17 (removal of 3d deadband configuration
via MSP_3D/MSP_SET_3D) At somepoint we can add the support for the updated MSP_DEADBAND/MSP_SET_DEADBAND commands.10.3.x-maintenance
parent
a924e06c1b
commit
81a49d48b2
13
js/msp.js
13
js/msp.js
|
@ -444,8 +444,11 @@ var MSP = {
|
|||
_3D.deadband3d_high = data.getUint16(offset, 1);
|
||||
offset += 2;
|
||||
_3D.neutral3d = data.getUint16(offset, 1);
|
||||
offset += 2;
|
||||
_3D.deadband3d_throttle = data.getUint16(offset, 1);
|
||||
|
||||
if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
|
||||
offset += 2;
|
||||
_3D.deadband3d_throttle = data.getUint16(offset, 1);
|
||||
}
|
||||
break;
|
||||
case MSP_codes.MSP_MOTOR_PINS:
|
||||
console.log(data);
|
||||
|
@ -1330,8 +1333,10 @@ MSP.crunch = function (code) {
|
|||
buffer.push(highByte(_3D.deadband3d_high));
|
||||
buffer.push(lowByte(_3D.neutral3d));
|
||||
buffer.push(highByte(_3D.neutral3d));
|
||||
buffer.push(lowByte(_3D.deadband3d_throttle));
|
||||
buffer.push(highByte(_3D.deadband3d_throttle));
|
||||
if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
|
||||
buffer.push(lowByte(_3D.deadband3d_throttle));
|
||||
buffer.push(highByte(_3D.deadband3d_throttle));
|
||||
}
|
||||
break;
|
||||
|
||||
case MSP_codes.MSP_SET_RC_DEADBAND:
|
||||
|
|
|
@ -433,7 +433,7 @@
|
|||
i18n="configuration3dNeutral"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number">
|
||||
<div class="number 3ddeadbandthrottle" >
|
||||
<label> <input type="number" name="3ddeadbandthrottle" step="1" min="0" max="1000" /> <span
|
||||
i18n="configuration3dDeadbandThrottle"></span>
|
||||
</label>
|
||||
|
|
|
@ -407,7 +407,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
$('input[name="3ddeadbandlow"]').val(_3D.deadband3d_low);
|
||||
$('input[name="3ddeadbandhigh"]').val(_3D.deadband3d_high);
|
||||
$('input[name="3dneutral"]').val(_3D.neutral3d);
|
||||
$('input[name="3ddeadbandthrottle"]').val(_3D.deadband3d_throttle);
|
||||
if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
|
||||
$('input[name="3ddeadbandthrottle"]').val(_3D.deadband3d_throttle);
|
||||
} else {
|
||||
$('.3ddeadbandthrottle').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// UI hooks
|
||||
|
@ -487,7 +491,9 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
_3D.deadband3d_low = parseInt($('input[name="3ddeadbandlow"]').val());
|
||||
_3D.deadband3d_high = parseInt($('input[name="3ddeadbandhigh"]').val());
|
||||
_3D.neutral3d = parseInt($('input[name="3dneutral"]').val());
|
||||
_3D.deadband3d_throttle = ($('input[name="3ddeadbandthrottle"]').val());
|
||||
if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
|
||||
_3D.deadband3d_throttle = ($('input[name="3ddeadbandthrottle"]').val());
|
||||
}
|
||||
|
||||
|
||||
SENSOR_ALIGNMENT.align_gyro = parseInt(orientation_gyro_e.val());
|
||||
|
|
Loading…
Reference in New Issue