Skip to content

Commit

Permalink
Update IMU (remove legacy) (#4276)
Browse files Browse the repository at this point in the history
Update IMU
  • Loading branch information
haslinghuis authored Dec 31, 2024
1 parent e31cf53 commit 4bdf7fb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/js/tabs/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ setup.initialize = function (callback) {

const showSensorInfo = function() {
const gyroElements = [
'AUTO',
'NONE',
'DEFAULT',
'MPU6050',
'L3G4200D',
'MPU3050',
Expand All @@ -292,7 +292,7 @@ setup.initialize = function (callback) {
];

const accElements = [
'DEFAULT',
'AUTO',
'NONE',
'ADXL345',
'MPU6050',
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4bdf7fb

Please sign in to comment.