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.
pull/3/head
Dominic Clifton 9 years ago
parent a924e06c1b
commit 81a49d48b2

@ -444,8 +444,11 @@ var MSP = {
_3D.deadband3d_high = data.getUint16(offset, 1); _3D.deadband3d_high = data.getUint16(offset, 1);
offset += 2; offset += 2;
_3D.neutral3d = data.getUint16(offset, 1); _3D.neutral3d = data.getUint16(offset, 1);
if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
offset += 2; offset += 2;
_3D.deadband3d_throttle = data.getUint16(offset, 1); _3D.deadband3d_throttle = data.getUint16(offset, 1);
}
break; break;
case MSP_codes.MSP_MOTOR_PINS: case MSP_codes.MSP_MOTOR_PINS:
console.log(data); console.log(data);
@ -1330,8 +1333,10 @@ MSP.crunch = function (code) {
buffer.push(highByte(_3D.deadband3d_high)); buffer.push(highByte(_3D.deadband3d_high));
buffer.push(lowByte(_3D.neutral3d)); buffer.push(lowByte(_3D.neutral3d));
buffer.push(highByte(_3D.neutral3d)); buffer.push(highByte(_3D.neutral3d));
if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
buffer.push(lowByte(_3D.deadband3d_throttle)); buffer.push(lowByte(_3D.deadband3d_throttle));
buffer.push(highByte(_3D.deadband3d_throttle)); buffer.push(highByte(_3D.deadband3d_throttle));
}
break; break;
case MSP_codes.MSP_SET_RC_DEADBAND: case MSP_codes.MSP_SET_RC_DEADBAND:

@ -433,7 +433,7 @@
i18n="configuration3dNeutral"></span> i18n="configuration3dNeutral"></span>
</label> </label>
</div> </div>
<div class="number"> <div class="number 3ddeadbandthrottle" >
<label> <input type="number" name="3ddeadbandthrottle" step="1" min="0" max="1000" /> <span <label> <input type="number" name="3ddeadbandthrottle" step="1" min="0" max="1000" /> <span
i18n="configuration3dDeadbandThrottle"></span> i18n="configuration3dDeadbandThrottle"></span>
</label> </label>

@ -407,7 +407,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('input[name="3ddeadbandlow"]').val(_3D.deadband3d_low); $('input[name="3ddeadbandlow"]').val(_3D.deadband3d_low);
$('input[name="3ddeadbandhigh"]').val(_3D.deadband3d_high); $('input[name="3ddeadbandhigh"]').val(_3D.deadband3d_high);
$('input[name="3dneutral"]').val(_3D.neutral3d); $('input[name="3dneutral"]').val(_3D.neutral3d);
if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
$('input[name="3ddeadbandthrottle"]').val(_3D.deadband3d_throttle); $('input[name="3ddeadbandthrottle"]').val(_3D.deadband3d_throttle);
} else {
$('.3ddeadbandthrottle').hide();
}
} }
// UI hooks // UI hooks
@ -487,7 +491,9 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
_3D.deadband3d_low = parseInt($('input[name="3ddeadbandlow"]').val()); _3D.deadband3d_low = parseInt($('input[name="3ddeadbandlow"]').val());
_3D.deadband3d_high = parseInt($('input[name="3ddeadbandhigh"]').val()); _3D.deadband3d_high = parseInt($('input[name="3ddeadbandhigh"]').val());
_3D.neutral3d = parseInt($('input[name="3dneutral"]').val()); _3D.neutral3d = parseInt($('input[name="3dneutral"]').val());
if (semver.lt(CONFIG.apiVersion, "1.17.0")) {
_3D.deadband3d_throttle = ($('input[name="3ddeadbandthrottle"]').val()); _3D.deadband3d_throttle = ($('input[name="3ddeadbandthrottle"]').val());
}
SENSOR_ALIGNMENT.align_gyro = parseInt(orientation_gyro_e.val()); SENSOR_ALIGNMENT.align_gyro = parseInt(orientation_gyro_e.val());

Loading…
Cancel
Save