diff --git a/js/serial_backend.js b/js/serial_backend.js index ce93ecfe..7af7af81 100755 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -389,7 +389,7 @@ function sensor_status(sensors_detected) { $('.accicon', e_sensor_status).removeClass('active'); } - if (CONFIG.boardType == 0 || CONFIG.boardType == 2) { // Gyro status is not reported by FC + if ((CONFIG.boardType == 0 || CONFIG.boardType == 2) && have_sensor(sensors_detected, 'gyro')) { $('.gyro', e_sensor_status).addClass('on'); $('.gyroicon', e_sensor_status).addClass('active'); } else { @@ -443,6 +443,18 @@ function have_sensor(sensors_detected, sensor_code) { case 'sonar': return bit_check(sensors_detected, 4); } + + if (bit_check(sensors_detected, 5)) { + switch (sensor_code) { + case 'gyro': + return bit_check(sensors_detected, 6); + } + } + + if (sensor_code == 'gyro) { + return true; + } + return false; }