1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 12:55:14 +03:00

Additional fix for initial run when configurator is first loaded

This commit is contained in:
KiteAnton 2016-06-13 23:02:09 +02:00
parent 18c434d924
commit 78aff406e4

View file

@ -304,7 +304,7 @@ function read_serial(info) {
function sensor_status(sensors_detected) {
// initialize variable (if it wasn't)
if (!sensor_status.previous_sensors_detected) {
sensor_status.previous_sensors_detected = 0;
sensor_status.previous_sensors_detected = -1; // Otherwise first iteration will not be run if sensors_detected == 0
}
// update UI (if necessary)
@ -326,7 +326,7 @@ function sensor_status(sensors_detected) {
$('.accicon', e_sensor_status).removeClass('active');
}
if (have_sensor(sensors_detected, 'gyro')) {
if (true) { // Gyro status is not reported by FC
$('.gyro', e_sensor_status).addClass('on');
$('.gyroicon', e_sensor_status).addClass('active');
} else {
@ -379,8 +379,6 @@ function have_sensor(sensors_detected, sensor_code) {
return bit_check(sensors_detected, 3);
case 'sonar':
return bit_check(sensors_detected, 4);
case 'gyro':
return true; // Gyro status is never reported by FC
}
return false;
}