mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Add Galileo and Home Point once to GPS
This commit is contained in:
parent
e69c904730
commit
ce044622a2
6 changed files with 69 additions and 7 deletions
|
@ -301,6 +301,8 @@ var FC = {
|
|||
ublox_sbas: 0,
|
||||
auto_config: 0,
|
||||
auto_baud: 0,
|
||||
home_point_once: false,
|
||||
ublox_use_galileo: false,
|
||||
};
|
||||
|
||||
COMPASS_CONFIG = {
|
||||
|
|
|
@ -423,6 +423,11 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
if (semver.gte(CONFIG.apiVersion, "1.34.0")) {
|
||||
GPS_CONFIG.auto_config = data.readU8();
|
||||
GPS_CONFIG.auto_baud = data.readU8();
|
||||
|
||||
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
|
||||
GPS_CONFIG.home_point_once = data.readU8() !== 0;
|
||||
GPS_CONFIG.ublox_use_galileo = data.readU8() !== 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MSPCodes.MSP_GPS_RESCUE:
|
||||
|
@ -1693,6 +1698,11 @@ MspHelper.prototype.crunch = function(code) {
|
|||
if (semver.gte(CONFIG.apiVersion, "1.34.0")) {
|
||||
buffer.push8(GPS_CONFIG.auto_config)
|
||||
.push8(GPS_CONFIG.auto_baud);
|
||||
|
||||
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
|
||||
buffer.push8(GPS_CONFIG.home_point_once ? 1 : 0)
|
||||
.push8(GPS_CONFIG.ublox_use_galileo ? 1 : 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MSPCodes.MSP_SET_GPS_RESCUE:
|
||||
|
|
|
@ -709,11 +709,24 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
gps_protocol_e.append('<option value="' + i + '">' + gpsProtocols[i] + '</option>');
|
||||
}
|
||||
|
||||
const gps_ublox_galileo_e = $('.gps_ublox_galileo');
|
||||
|
||||
gps_protocol_e.change(function () {
|
||||
GPS_CONFIG.provider = parseInt($(this).val());
|
||||
});
|
||||
|
||||
gps_protocol_e.val(GPS_CONFIG.provider);
|
||||
const enableGalileoVisible = semver.gte(CONFIG.apiVersion, "1.43.0") && GPS_CONFIG.provider === gpsProtocols.indexOf('UBLOX');
|
||||
gps_ublox_galileo_e.toggle(enableGalileoVisible);
|
||||
});
|
||||
gps_protocol_e.val(GPS_CONFIG.provider).change();
|
||||
|
||||
$('input[name="gps_ublox_galileo"]').change(function() {
|
||||
GPS_CONFIG.ublox_use_galileo = $(this).is(':checked');
|
||||
}).prop('checked', GPS_CONFIG.ublox_use_galileo).change();
|
||||
|
||||
$('.gps_home_once').toggle(semver.gte(CONFIG.apiVersion, "1.43.0"));
|
||||
$('input[name="gps_home_once"]').change(function() {
|
||||
GPS_CONFIG.home_point_once = $(this).is(':checked');
|
||||
}).prop('checked', GPS_CONFIG.home_point_once).change();
|
||||
|
||||
$('input[name="gps_auto_baud"]').prop('checked', GPS_CONFIG.auto_baud == 1);
|
||||
$('input[name="gps_auto_config"]').prop('checked', GPS_CONFIG.auto_config == 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue