Skip to content
Snippets Groups Projects
Commit abf3d1d9 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

mpu9250: getRawMagnet: pass request success to userland

parent 0af72f0d
No related branches found
No related tags found
No related merge requests found
......@@ -269,7 +269,7 @@ class MPU9250 {
inline int getGyroZ() { return getWordReg(71); }
void getRawAccel(int *x, int *y, int *z);
void getRawGyro(int *x, int *y, int *z);
void getRawMagnet(int *x, int *y, int *z);
bool getRawMagnet(int *x, int *y, int *z);
void getAccel(float *g_x, float *g_y, float *g_z);
void getGyro(float *dps_x, float *dps_y, float *dps_z);
void getMagnet(int *x, int *y, int *z);
......
......@@ -201,7 +201,7 @@ void MPU9250::getGyro(float *dps_x, float *dps_y, float *dps_z)
*dps_z = z * fsr_factor;
}
void MPU9250::getRawMagnet(int *x, int *y, int *z)
bool MPU9250::getRawMagnet(int *x, int *y, int *z)
{
txbuf[0] = 0x02;
i2c.xmit(0x0c, 1, txbuf, 8, rxbuf);
......@@ -210,9 +210,10 @@ void MPU9250::getRawMagnet(int *x, int *y, int *z)
*x = ((signed int)rxbuf[2] << 8) + rxbuf[1];
*y = ((signed int)rxbuf[4] << 8) + rxbuf[3];
*z = ((signed int)rxbuf[6] << 8) + rxbuf[5];
return true;
}
else {
*x = *y = *z = 0;
return false;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment