mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-07 23:15:53 +00:00
Cleanup for 20948 compass
This commit is contained in:
parent
d6958b68d6
commit
bf0a5ca83d
@ -1300,6 +1300,7 @@ void setup()
|
|||||||
LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap());
|
LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap());
|
||||||
LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram());
|
LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram());
|
||||||
#endif
|
#endif
|
||||||
|
if (accelerometerThread)
|
||||||
accelerometerThread->calibrate(30);
|
accelerometerThread->calibrate(30);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -88,18 +88,16 @@ int32_t ICM20948Sensor::runOnce()
|
|||||||
// lowestY, highestY, lowestZ, highestZ);
|
// lowestY, highestY, lowestZ, highestZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
int highestRealX = highestX - (highestX + lowestX) / 2;
|
|
||||||
|
|
||||||
magX -= (highestX + lowestX) / 2;
|
magX -= (highestX + lowestX) / 2;
|
||||||
magY -= (highestY + lowestY) / 2;
|
magY -= (highestY + lowestY) / 2;
|
||||||
magZ -= (highestZ + lowestZ) / 2;
|
magZ -= (highestZ + lowestZ) / 2;
|
||||||
FusionVector ga, ma;
|
FusionVector ga, ma;
|
||||||
ga.axis.x = -(sensor->agmt.acc.axes.x); // default location for the BMX160 is on the rear of the board
|
ga.axis.x = (sensor->agmt.acc.axes.x);
|
||||||
ga.axis.y = -(sensor->agmt.acc.axes.y);
|
ga.axis.y = -(sensor->agmt.acc.axes.y);
|
||||||
ga.axis.z = (sensor->agmt.acc.axes.z);
|
ga.axis.z = -(sensor->agmt.acc.axes.z);
|
||||||
ma.axis.x = -magX;
|
ma.axis.x = magX;
|
||||||
ma.axis.y = -magY;
|
ma.axis.y = magY;
|
||||||
ma.axis.z = magZ * 3;
|
ma.axis.z = magZ;
|
||||||
|
|
||||||
// If we're set to one of the inverted positions
|
// If we're set to one of the inverted positions
|
||||||
if (config.display.compass_orientation > meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270) {
|
if (config.display.compass_orientation > meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270) {
|
||||||
|
Loading…
Reference in New Issue
Block a user