Fixing backwards compatibility of prodrone's failsafe tab
parent
c1a7452b27
commit
a72a00a2de
22
js/msp.js
22
js/msp.js
|
@ -818,12 +818,14 @@ var MSP = {
|
||||||
offset++;
|
offset++;
|
||||||
FAILSAFE_CONFIG.failsafe_throttle = data.getUint16(offset, 1);
|
FAILSAFE_CONFIG.failsafe_throttle = data.getUint16(offset, 1);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
FAILSAFE_CONFIG.failsafe_kill_switch = data.getUint8(offset, 1);
|
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||||
offset++;
|
FAILSAFE_CONFIG.failsafe_kill_switch = data.getUint8(offset, 1);
|
||||||
FAILSAFE_CONFIG.failsafe_throttle_low_delay = data.getUint16(offset, 1);
|
offset++;
|
||||||
offset += 2;
|
FAILSAFE_CONFIG.failsafe_throttle_low_delay = data.getUint16(offset, 1);
|
||||||
FAILSAFE_CONFIG.failsafe_procedure = data.getUint8(offset, 1);
|
offset += 2;
|
||||||
offset++;
|
FAILSAFE_CONFIG.failsafe_procedure = data.getUint8(offset, 1);
|
||||||
|
offset++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_codes.MSP_RXFAIL_CONFIG:
|
case MSP_codes.MSP_RXFAIL_CONFIG:
|
||||||
|
@ -1206,9 +1208,11 @@ MSP.crunch = function (code) {
|
||||||
buffer.push(lowByte(FAILSAFE_CONFIG.failsafe_throttle));
|
buffer.push(lowByte(FAILSAFE_CONFIG.failsafe_throttle));
|
||||||
buffer.push(highByte(FAILSAFE_CONFIG.failsafe_throttle));
|
buffer.push(highByte(FAILSAFE_CONFIG.failsafe_throttle));
|
||||||
buffer.push(FAILSAFE_CONFIG.failsafe_kill_switch);
|
buffer.push(FAILSAFE_CONFIG.failsafe_kill_switch);
|
||||||
buffer.push(lowByte(FAILSAFE_CONFIG.failsafe_throttle_low_delay));
|
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||||
buffer.push(highByte(FAILSAFE_CONFIG.failsafe_throttle_low_delay));
|
buffer.push(lowByte(FAILSAFE_CONFIG.failsafe_throttle_low_delay));
|
||||||
buffer.push(FAILSAFE_CONFIG.failsafe_procedure);
|
buffer.push(highByte(FAILSAFE_CONFIG.failsafe_throttle_low_delay));
|
||||||
|
buffer.push(FAILSAFE_CONFIG.failsafe_procedure);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_codes.MSP_SET_RXFAIL_CONFIG:
|
case MSP_codes.MSP_SET_RXFAIL_CONFIG:
|
||||||
|
|
Loading…
Reference in New Issue