mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-07 15:12:45 +00:00
Cleanup for 20948 compass
This commit is contained in:
parent
d6958b68d6
commit
bf0a5ca83d
@ -1300,7 +1300,8 @@ void setup()
|
||||
LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap());
|
||||
LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram());
|
||||
#endif
|
||||
accelerometerThread->calibrate(30);
|
||||
if (accelerometerThread)
|
||||
accelerometerThread->calibrate(30);
|
||||
}
|
||||
#endif
|
||||
uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
|
||||
|
@ -88,18 +88,16 @@ int32_t ICM20948Sensor::runOnce()
|
||||
// lowestY, highestY, lowestZ, highestZ);
|
||||
}
|
||||
|
||||
int highestRealX = highestX - (highestX + lowestX) / 2;
|
||||
|
||||
magX -= (highestX + lowestX) / 2;
|
||||
magY -= (highestY + lowestY) / 2;
|
||||
magZ -= (highestZ + lowestZ) / 2;
|
||||
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.z = (sensor->agmt.acc.axes.z);
|
||||
ma.axis.x = -magX;
|
||||
ma.axis.y = -magY;
|
||||
ma.axis.z = magZ * 3;
|
||||
ga.axis.z = -(sensor->agmt.acc.axes.z);
|
||||
ma.axis.x = magX;
|
||||
ma.axis.y = magY;
|
||||
ma.axis.z = magZ;
|
||||
|
||||
// If we're set to one of the inverted positions
|
||||
if (config.display.compass_orientation > meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270) {
|
||||
|
Loading…
Reference in New Issue
Block a user