mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
Allow baud rate configuration on the Configuration tab.
This commit is contained in:
parent
8257efffa8
commit
26d6c1a562
3 changed files with 22 additions and 18 deletions
|
@ -429,7 +429,7 @@
|
||||||
"configurationGPSProtocol": {
|
"configurationGPSProtocol": {
|
||||||
"message": "Protocol"
|
"message": "Protocol"
|
||||||
},
|
},
|
||||||
"configurationGPSbaudrate": {
|
"configurationGPSBaudrate": {
|
||||||
"message": "Baudrate"
|
"message": "Baudrate"
|
||||||
},
|
},
|
||||||
"configurationGPSubxSbas": {
|
"configurationGPSubxSbas": {
|
||||||
|
|
|
@ -164,12 +164,12 @@
|
||||||
</select>
|
</select>
|
||||||
<span i18n="configurationGPSProtocol"></span>
|
<span i18n="configurationGPSProtocol"></span>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="line"> -->
|
<div class="line">
|
||||||
<!-- <select class="gps_baudrate"> -->
|
<select class="gps_baudrate">
|
||||||
<!-- list generated here -->
|
<!-- list generated here -->
|
||||||
<!-- </select> -->
|
</select>
|
||||||
<!-- <span i18n="configurationGPSbaudrate"></span> -->
|
<span i18n="configurationGPSBaudrate"></span>
|
||||||
<!-- </div> -->
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<select class="gps_ubx_sbas">
|
<select class="gps_ubx_sbas">
|
||||||
<!-- list generated here -->
|
<!-- list generated here -->
|
||||||
|
|
|
@ -11,7 +11,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_config() {
|
function load_config() {
|
||||||
MSP.send_message(MSP_codes.MSP_BF_CONFIG, false, false, load_rc_map);
|
MSP.send_message(MSP_codes.MSP_BF_CONFIG, false, false, load_serial_config);
|
||||||
|
}
|
||||||
|
|
||||||
|
function load_serial_config() {
|
||||||
|
MSP.send_message(MSP_codes.MSP_CF_SERIAL_CONFIG, false, false, load_rc_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_rc_map() {
|
function load_rc_map() {
|
||||||
|
@ -117,15 +121,13 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
'UBLOX'
|
'UBLOX'
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
var gpsBaudRates = [
|
||||||
var gpsBauds = [
|
|
||||||
'115200',
|
'115200',
|
||||||
'57600',
|
'57600',
|
||||||
'38400',
|
'38400',
|
||||||
'19200',
|
'19200',
|
||||||
'9600'
|
'9600'
|
||||||
];
|
];
|
||||||
*/
|
|
||||||
|
|
||||||
var gpsSbas = [
|
var gpsSbas = [
|
||||||
'Disabled',
|
'Disabled',
|
||||||
|
@ -145,16 +147,14 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
MISC.gps_type = parseInt($(this).val());
|
MISC.gps_type = parseInt($(this).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
var gps_baudrate_e = $('select.gps_baudrate');
|
var gps_baudrate_e = $('select.gps_baudrate');
|
||||||
for (var i = 0; i < gpsBauds.length; i++) {
|
for (var i = 0; i < gpsBaudRates.length; i++) {
|
||||||
gps_baudrate_e.append('<option value="' + i + '">' + gpsBauds[i] + '</option>');
|
gps_baudrate_e.append('<option value="' + gpsBaudRates[i] + '">' + gpsBaudRates[i] + '</option>');
|
||||||
}
|
}
|
||||||
|
|
||||||
gps_baudrate_e.change(function () {
|
gps_baudrate_e.change(function () {
|
||||||
MISC.gps_baudrate = parseInt($(this).val());
|
SERIAL_CONFIG.gpsBaudRate = parseInt($(this).val());
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
var gps_ubx_sbas_e = $('select.gps_ubx_sbas');
|
var gps_ubx_sbas_e = $('select.gps_ubx_sbas');
|
||||||
for (var i = 0; i < gpsSbas.length; i++) {
|
for (var i = 0; i < gpsSbas.length; i++) {
|
||||||
|
@ -167,7 +167,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
// select current gps configuration
|
// select current gps configuration
|
||||||
gps_protocol_e.val(MISC.gps_type);
|
gps_protocol_e.val(MISC.gps_type);
|
||||||
//gps_baudrate_e.val(MISC.gps_baudrate);
|
gps_baudrate_e.val(SERIAL_CONFIG.gpsBaudRate);
|
||||||
gps_ubx_sbas_e.val(MISC.gps_ubx_sbas);
|
gps_ubx_sbas_e.val(MISC.gps_ubx_sbas);
|
||||||
|
|
||||||
// generate serial RX
|
// generate serial RX
|
||||||
|
@ -287,6 +287,10 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
BF_CONFIG.currentoffset = parseInt($('input[name="currentoffset"]').val());
|
BF_CONFIG.currentoffset = parseInt($('input[name="currentoffset"]').val());
|
||||||
MISC.multiwiicurrentoutput = ~~$('input[name="multiwiicurrentoutput"]').is(':checked'); // ~~ boolean to decimal conversion
|
MISC.multiwiicurrentoutput = ~~$('input[name="multiwiicurrentoutput"]').is(':checked'); // ~~ boolean to decimal conversion
|
||||||
|
|
||||||
|
function save_serial_config() {
|
||||||
|
MSP.send_message(MSP_codes.MSP_SET_CF_SERIAL_CONFIG, MSP.crunch(MSP_codes.MSP_SET_CF_SERIAL_CONFIG), false, save_misc);
|
||||||
|
}
|
||||||
|
|
||||||
function save_misc() {
|
function save_misc() {
|
||||||
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_acc_trim);
|
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_acc_trim);
|
||||||
}
|
}
|
||||||
|
@ -318,7 +322,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
},1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts
|
},1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts
|
||||||
}
|
}
|
||||||
|
|
||||||
MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_misc);
|
MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_serial_config);
|
||||||
});
|
});
|
||||||
|
|
||||||
// status data pulled via separate timer with static speed
|
// status data pulled via separate timer with static speed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue