Fix MPU9250 compilation with Mahony / Madgwick enabled (#151)

This commit is contained in:
TheDevMinerTV
2022-04-16 15:23:09 +02:00
committed by GitHub
parent 816a359e06
commit e567bb43db

View File

@@ -171,9 +171,9 @@ void MPU9250Sensor::motionLoop() {
last = now;
getMPUScaled();
#if defined(_MAHONY_H_))
#if defined(_MAHONY_H_)
mahonyQuaternionUpdate(q, Axyz[0], Axyz[1], Axyz[2], Gxyz[0], Gxyz[1], Gxyz[2], Mxyz[0], Mxyz[1], Mxyz[2], deltat * 1.0e-6);
#elif defined(_MADGWICK_H_))
#elif defined(_MADGWICK_H_)
madgwickQuaternionUpdate(q, Axyz[0], Axyz[1], Axyz[2], Gxyz[0], Gxyz[1], Gxyz[2], Mxyz[0], Mxyz[1], Mxyz[2], deltat * 1.0e-6);
#endif
quaternion.set(-q[2], q[1], q[3], q[0]);