mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
initial code for gps strength indicator
This commit is contained in:
parent
21b0248430
commit
58d34ee9e5
8 changed files with 222 additions and 49 deletions
|
@ -37,6 +37,8 @@ $(document).ready(function() {
|
|||
$('#content').load("./tabs/receiver.html", tab_initialize_receiver);
|
||||
} else if ($(this).parent().hasClass('tab_auxiliary_configuration')) {
|
||||
$('#content').load("./tabs/auxiliary_configuration.html", tab_initialize_auxiliary_configuration);
|
||||
} else if ($(this).parent().hasClass('tab_gps')) {
|
||||
$('#content').load("./tabs/gps.html", tab_initialize_gps);
|
||||
} else if ($(this).parent().hasClass('tab_motor_outputs')) {
|
||||
$('#content').load("./tabs/motor_outputs.html", tab_initialize_motor_outputs);
|
||||
} else if ($(this).parent().hasClass('tab_sensors')) {
|
||||
|
@ -50,7 +52,7 @@ $(document).ready(function() {
|
|||
});
|
||||
|
||||
// temporary
|
||||
//$('#content').load("./tabs/initial_setup.html", tab_initialize_initial_setup);
|
||||
//$('#content').load("./tabs/gps.html", tab_initialize_gps);
|
||||
});
|
||||
|
||||
function disable_timers() {
|
||||
|
|
|
@ -43,7 +43,8 @@ var MSP_codes = {
|
|||
// Additional baseflight commands that are not compatible with MultiWii
|
||||
MSP_UID: 160,
|
||||
MSP_ACC_TRIM: 240,
|
||||
MSP_SET_ACC_TRIM: 239
|
||||
MSP_SET_ACC_TRIM: 239,
|
||||
MSP_GPSSVINFO: 164 // get Signal Strength (only U-Blox)
|
||||
}
|
||||
|
||||
var CONFIG = {
|
||||
|
@ -109,7 +110,13 @@ var GPS_DATA = {
|
|||
speed: 0,
|
||||
distanceToHome: 0,
|
||||
ditectionToHome: 0,
|
||||
update: 0
|
||||
update: 0,
|
||||
|
||||
// baseflight specific gps stuff
|
||||
chn: new Array(),
|
||||
svid: new Array(),
|
||||
quality: new Array(),
|
||||
cno: new Array()
|
||||
}
|
||||
|
||||
var BATTERY = {
|
||||
|
@ -654,6 +661,23 @@ function process_message(code, data) {
|
|||
case MSP_codes.MSP_SET_ACC_TRIM:
|
||||
console.log('Accelerometer trimms saved.');
|
||||
break;
|
||||
case MSP_codes.MSP_GPSSVINFO:
|
||||
if (data.byteLength > 0) {
|
||||
var numCh = view.getUint8(0);
|
||||
|
||||
var needle = 1;
|
||||
for (var i = 0; i < numCh; i++) {
|
||||
GPS_DATA.chn[i] = view.getUint8(needle);
|
||||
GPS_DATA.svid[i] = view.getUint8(needle + 1);
|
||||
GPS_DATA.quality[i] = view.getUint8(needle + 2);
|
||||
GPS_DATA.cno[i] = view.getUint8(needle + 3);
|
||||
|
||||
needle += 4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
console.log('Unknown code detected: ' + code);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue