1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 22:05:17 +03:00

accel and mag calibration hooks

This commit is contained in:
cTn 2013-04-08 22:02:58 +02:00
parent 9fda14b5f2
commit ae7a6cfa0a
6 changed files with 72 additions and 9 deletions

View file

@ -129,10 +129,8 @@ function onOpen(openInfo) {
serial_poll = setInterval(readPoll, 10);
// should request some sort of configuration data
//send_message(MSP_codes.MSP_ACC_CALIBRATION, MSP_codes.MSP_ACC_CALIBRATION);
send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS);
send_message(MSP_codes.MSP_IDENT, MSP_codes.MSP_IDENT);
//send_message(MSP_codes.MSP_BOXNAMES, MSP_codes.MSP_BOXNAMES);
send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS);
}, connection_delay * 1000);
}
@ -371,10 +369,10 @@ function process_message(code, data) {
console.log(data);
break;
case MSP_codes.MSP_ACC_CALIBRATION:
console.log('Accel calibration finished');
console.log('Accel calibration executed');
break;
case MSP_codes.MSP_MAG_CALIBRATION:
console.log('Mag calibration finished');
console.log('Mag calibration executed');
break;
case MSP_codes.MSP_SET_MISC:
console.log(data);
@ -421,7 +419,19 @@ function sensor_status(sensors_detected) {
$('.mag', e_sensor_status).addClass('on');
} else {
$('.mag', e_sensor_status).removeClass('on');
}
}
if (bit_check(sensors_detected, 3)) { // GPS detected
$('.gps', e_sensor_status).addClass('on');
} else {
$('.gps', e_sensor_status).removeClass('on');
}
if (bit_check(sensors_detected, 4)) { // Sonar detected
$('.sonar', e_sensor_status).addClass('on');
} else {
$('.sonar', e_sensor_status).removeClass('on');
}
}
function highByte(num) {