Skip to content

Commit

Permalink
Remove auto_baud
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Jul 24, 2023
1 parent 62a9cde commit bdd1f4b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/js/tabs/gps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { i18n } from "../localization";
import semver from 'semver';
import { API_VERSION_1_43 } from '../data_storage';
import { API_VERSION_1_43, API_VERSION_1_46 } from '../data_storage';
import GUI, { TABS } from '../gui';
import FC from '../fc';
import MSP from "../msp";
Expand Down Expand Up @@ -132,7 +132,10 @@ gps.initialize = async function (callback) {

}).val(FC.GPS_CONFIG.provider).change();

gpsAutoBaudElement.prop('checked', FC.GPS_CONFIG.auto_baud === 1);
// auto_baud is no longer used in API 1.46
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_46)) {
gpsAutoBaudElement.prop('checked', FC.GPS_CONFIG.auto_baud === 1);
}

gpsAutoConfigElement.on('change', function () {
const checked = $(this).is(":checked");
Expand All @@ -146,7 +149,7 @@ gps.initialize = async function (callback) {
const enableSbasVisible = checked && ubloxSelected;
gpsUbloxSbasGroup.toggle(enableSbasVisible);

gpsAutoBaudGroup.toggle(ubloxSelected || mspSelected);
gpsAutoBaudGroup.toggle((ubloxSelected || mspSelected) && semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_46));
gpsAutoConfigGroup.toggle(ubloxSelected || mspSelected);

}).prop('checked', FC.GPS_CONFIG.auto_config === 1).trigger('change');
Expand Down

0 comments on commit bdd1f4b

Please sign in to comment.