1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-20 23:05:15 +03:00

replace bit_check with have_sensor for better readable, cleanups

This commit is contained in:
TheAngularity 2016-07-22 13:08:50 +02:00 committed by GitHub
parent 1fdb7a8eaa
commit 6055f73f94

View file

@ -185,16 +185,16 @@ TABS.sensors.initialize = function (callback) {
// disable graphs for sensors that are missing
var checkboxes = $('.tab-sensors .info .checkboxes input');
if (!have_sensor(CONFIG.activeSensors, 'acc')) { // acc
if (!have_sensor(CONFIG.activeSensors, 'acc')) {
checkboxes.eq(1).prop('disabled', true);
}
if (!bit_check(CONFIG.activeSensors, 1)) { // baro
checkboxes.eq(3).prop('disabled', true);
}
if (!bit_check(CONFIG.activeSensors, 2)) { // mag
if (!have_sensor(CONFIG.activeSensors, 'mag')) {
checkboxes.eq(2).prop('disabled', true);
}
if (!bit_check(CONFIG.activeSensors, 4)) { // sonar
if (!have_sensor(CONFIG.activeSensors, 'baro')) {
checkboxes.eq(3).prop('disabled', true);
}
if (!have_sensor(CONFIG.activeSensors, 'sonar')) {
checkboxes.eq(4).prop('disabled', true);
}