summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-12-12 10:35:00 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2019-12-12 10:35:00 +0100
commitead2cee85e7497a06f431c3271e44f614f102e8c (patch)
treefe0542b96ab48cdda2d73d5e115dadcae6ec12ce
parentc3286ffc8c50e75cbddafb988738cd9566d5a023 (diff)
mpu9250: Fix setGyroEnable/setAccelEnable. derp....
-rw-r--r--src/driver/mpu9250.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/driver/mpu9250.cc b/src/driver/mpu9250.cc
index 58796c5..32f78c7 100644
--- a/src/driver/mpu9250.cc
+++ b/src/driver/mpu9250.cc
@@ -47,7 +47,7 @@ void MPU9250::setGyroEnable(bool x, bool y, bool z)
txbuf[0] = 108;
i2c.xmit(address, 1, txbuf, 1, txbuf + 1); // not a typo
- txbuf[1] &= 0x07;
+ txbuf[1] &= ~0x07;
if (!x) {
txbuf[1] |= 4;
@@ -67,7 +67,7 @@ void MPU9250::setAccelEnable(bool x, bool y, bool z)
txbuf[0] = 108;
i2c.xmit(address, 1, txbuf, 1, txbuf + 1); // not a typo
- txbuf[1] &= 0xf8;
+ txbuf[1] &= ~0x38;
if (!x) {
txbuf[1] |= 1<<5;
@@ -238,7 +238,7 @@ void MPU9250::standby()
setGyroStandby(true);
MagSleep();
setAccelEnable(false, false, false);
- // TODO setGyroEnable false/true?
+ setGyroEnable(true, true, true);
}
void MPU9250::lowPowerAccelOnly(unsigned char rate)
@@ -251,7 +251,7 @@ void MPU9250::lowPowerAccelOnly(unsigned char rate)
txbuf[1] = 1<<5;
i2c.xmit(address, 2, txbuf, 0, rxbuf);
setGyroEnable(false, false, false);
- // TODO setAccelEnable true?
+ setAccelEnable(true, true, true);
}
void MPU9250::accelOnly()
@@ -260,7 +260,7 @@ void MPU9250::accelOnly()
AGWakeup();
MagSleep();
setGyroEnable(false, false, false);
- // TODO setAccelEnable true?
+ setAccelEnable(true, true, true);
}
void MPU9250::gyroOnly()
@@ -269,7 +269,7 @@ void MPU9250::gyroOnly()
AGWakeup();
MagSleep();
setAccelEnable(false, false, false);
- // TODO setGyroEnable true?
+ setGyroEnable(true, true, true);
}
void MPU9250::magnetOnly()