From cfdefd9ca6d5a94565d244bb685158caa6629b16 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Tue, 17 Dec 2024 22:09:33 +0100 Subject: [PATCH] Update IMU --- src/js/tabs/setup.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/js/tabs/setup.js b/src/js/tabs/setup.js index 367c8fed05..3de7f50260 100644 --- a/src/js/tabs/setup.js +++ b/src/js/tabs/setup.js @@ -268,8 +268,8 @@ setup.initialize = function (callback) { const showSensorInfo = function() { const gyroElements = [ + 'AUTO', 'NONE', - 'DEFAULT', 'MPU6050', 'L3G4200D', 'MPU3050', @@ -292,7 +292,7 @@ setup.initialize = function (callback) { ]; const accElements = [ - 'DEFAULT', + 'AUTO', 'NONE', 'ADXL345', 'MPU6050', @@ -350,6 +350,17 @@ setup.initialize = function (callback) { 'TF02', ]; + // remove deprecated sensors + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + gyroElements.splice(gyroElements.indexOf("L3G4200D"), 1); + gyroElements.splice(gyroElements.indexOf("MPU3050"), 1); + + accElements.splice(accElements.indexOf("ADXL345"), 1); + accElements.splice(accElements.indexOf("MMA8452"), 1); + accElements.splice(accElements.indexOf("BMA280"), 1); + accElements.splice(accElements.indexOf("LSM303DLHC"), 1); + } + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { MSP.send_message(MSPCodes.MSP2_SENSOR_CONFIG_ACTIVE, false, false, function() { // Sensor info