Skip to content

Commit

Permalink
Add semver magic
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed May 6, 2024
1 parent 1612755 commit 1fdf3b4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/js/tabs/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { mspHelper } from '../msp/MSPHelper';
import FC from '../fc';
import MSP from '../msp';
import MSPCodes from '../msp/MSPCodes';
import { API_VERSION_1_42, API_VERSION_1_43, API_VERSION_1_45 } from '../data_storage';
import { API_VERSION_1_42, API_VERSION_1_43, API_VERSION_1_45, API_VERSION_1_47 } from '../data_storage';
import { updateTabList } from '../utils/updateTabList';
import $ from 'jquery';

Expand Down Expand Up @@ -344,11 +344,17 @@ configuration.initialize = function (callback) {
$('input[name="pitch"]').val(FC.CONFIG.accelerometerTrims[0]);

$('input[id="configurationSmallAngle"]').val(FC.ARMING_CONFIG.small_angle);
$('input[id="configurationGyroCalOnFirstArm"]').prop('checked', FC.ARMING_CONFIG.gyro_cal_on_first_arm === 1);

if (FC.FEATURE_CONFIG.features.isEnabled('MOTOR_STOP')) {
$('input[id="configurationAutoDisarmDelay"]').val(FC.ARMING_CONFIG.auto_disarm_delay);
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
$('input[id="configurationGyroCalOnFirstArm"]').prop('checked', FC.ARMING_CONFIG.gyro_cal_on_first_arm === 1);

if (FC.FEATURE_CONFIG.features.isEnabled('MOTOR_STOP')) {
$('input[id="configurationAutoDisarmDelay"]').val(FC.ARMING_CONFIG.auto_disarm_delay);
} else {
$('input[id="configurationAutoDisarmDelay"]').parent().hide();
}
} else {
$('input[id="configurationGyroCalOnFirstArm"]').parent().hide();
$('input[id="configurationAutoDisarmDelay"]').parent().hide();
}

Expand Down

0 comments on commit 1fdf3b4

Please sign in to comment.