1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 00:35:20 +03:00

* Properly guarding JS on for new variables introduced in 1.7.3/1.7.4

* Properly hiding/showing relevant controls for Minimum Failsafe Distance according to version (>= 1.7.4)
* Fixing bad maximum for centimeters distance
This commit is contained in:
Stewart Loving-Gibbard 2017-10-10 09:43:13 -07:00
parent 774d1c97e6
commit 0c1b48351e
3 changed files with 55 additions and 44 deletions

View file

@ -617,20 +617,24 @@ var mspHelper = (function (gui) {
offset += 2;
FAILSAFE_CONFIG.failsafe_procedure = data.getUint8(offset);
offset++;
FAILSAFE_CONFIG.failsafe_recovery_delay = data.getUint8(offset);
offset++;
FAILSAFE_CONFIG.failsafe_fw_roll_angle = data.getUint16(offset, true);
offset += 2;
FAILSAFE_CONFIG.failsafe_fw_pitch_angle = data.getUint16(offset, true);
offset += 2;
FAILSAFE_CONFIG.failsafe_fw_yaw_rate = data.getUint16(offset, true);
offset += 2;
FAILSAFE_CONFIG.failsafe_stick_motion_threshold = data.getUint16(offset, true);
offset += 2;
FAILSAFE_CONFIG.failsafe_min_distance = data.getUint16(offset, true);
offset += 2;
FAILSAFE_CONFIG.failsafe_min_distance_procedure = data.getUint8(offset);
offset++;
if (semver.gte(CONFIG.flightControllerVersion, "1.7.3")) {
FAILSAFE_CONFIG.failsafe_recovery_delay = data.getUint8(offset);
offset++;
FAILSAFE_CONFIG.failsafe_fw_roll_angle = data.getUint16(offset, true);
offset += 2;
FAILSAFE_CONFIG.failsafe_fw_pitch_angle = data.getUint16(offset, true);
offset += 2;
FAILSAFE_CONFIG.failsafe_fw_yaw_rate = data.getUint16(offset, true);
offset += 2;
FAILSAFE_CONFIG.failsafe_stick_motion_threshold = data.getUint16(offset, true);
offset += 2;
}
if (semver.gte(CONFIG.flightControllerVersion, "1.7.4")) {
FAILSAFE_CONFIG.failsafe_min_distance = data.getUint16(offset, true);
offset += 2;
FAILSAFE_CONFIG.failsafe_min_distance_procedure = data.getUint8(offset);
offset++;
}
break;
case MSPCodes.MSP_RXFAIL_CONFIG: