mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
accel and mag calibration hooks
This commit is contained in:
parent
9fda14b5f2
commit
ae7a6cfa0a
6 changed files with 72 additions and 9 deletions
|
@ -16,7 +16,7 @@ a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.clear-both {
|
.clear-both {
|
||||||
clear: both;
|
clear: both;
|
||||||
|
@ -171,3 +171,34 @@ a:hover {
|
||||||
|
|
||||||
border: 1px solid #848484;
|
border: 1px solid #848484;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* tab specific sections */
|
||||||
|
.tab-initial_setup .section {
|
||||||
|
clear: both;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
.tab-initial_setup .section a {
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
width: 160px;
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
|
||||||
|
border: 1px solid #c0c0c0;
|
||||||
|
background-color: #5569d0;
|
||||||
|
}
|
||||||
|
.tab-initial_setup .section a:hover {
|
||||||
|
background-color: #424d84;
|
||||||
|
}
|
||||||
|
.tab-initial_setup .section p {
|
||||||
|
margin-left: 180px;
|
||||||
|
|
||||||
|
padding: 5px;
|
||||||
|
|
||||||
|
border: 1px dotted silver;
|
||||||
|
}
|
|
@ -129,10 +129,8 @@ function onOpen(openInfo) {
|
||||||
serial_poll = setInterval(readPoll, 10);
|
serial_poll = setInterval(readPoll, 10);
|
||||||
|
|
||||||
// should request some sort of configuration data
|
// 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_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);
|
}, connection_delay * 1000);
|
||||||
}
|
}
|
||||||
|
@ -371,10 +369,10 @@ function process_message(code, data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_ACC_CALIBRATION:
|
case MSP_codes.MSP_ACC_CALIBRATION:
|
||||||
console.log('Accel calibration finished');
|
console.log('Accel calibration executed');
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_MAG_CALIBRATION:
|
case MSP_codes.MSP_MAG_CALIBRATION:
|
||||||
console.log('Mag calibration finished');
|
console.log('Mag calibration executed');
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_SET_MISC:
|
case MSP_codes.MSP_SET_MISC:
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
@ -422,6 +420,18 @@ function sensor_status(sensors_detected) {
|
||||||
} else {
|
} else {
|
||||||
$('.mag', e_sensor_status).removeClass('on');
|
$('.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) {
|
function highByte(num) {
|
||||||
|
|
|
@ -66,7 +66,6 @@
|
||||||
<li class="baro">Baro</li>
|
<li class="baro">Baro</li>
|
||||||
<li class="gps">GPS</li>
|
<li class="gps">GPS</li>
|
||||||
<li class="sonar">Sonar</li>
|
<li class="sonar">Sonar</li>
|
||||||
<li class="optic">Optic</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear-both"></div>
|
<div class="clear-both"></div>
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<div class="tab-initial_setup">
|
||||||
|
<div class="section">
|
||||||
|
<a class="calibrateAccel" href="#">Calibrate Accelerometer</a>
|
||||||
|
<p>
|
||||||
|
Some info / rules about calibration goes here
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="section">
|
||||||
|
<a class="calibrateMag" href="#">Calibrate Magnetometer</a>
|
||||||
|
<p>
|
||||||
|
Some info / rules about calibration goes here
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,2 +1,9 @@
|
||||||
function tab_initialize_initial_setup() {
|
function tab_initialize_initial_setup() {
|
||||||
|
$('a.calibrateAccel').click(function() {
|
||||||
|
send_message(MSP_codes.MSP_ACC_CALIBRATION, MSP_codes.MSP_ACC_CALIBRATION);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('a.calibrateMag').click(function() {
|
||||||
|
send_message(MSP_codes.MSP_MAG_CALIBRATION, MSP_codes.MSP_MAG_CALIBRATION);
|
||||||
|
});
|
||||||
}
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
<div class="tab-pid_tuning">
|
||||||
|
</div>
|
Loading…
Add table
Add a link
Reference in a new issue