summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-12-11 15:49:50 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-12-11 15:49:50 +0100
commit182a42b89c5eb2373a3725a7aea197e6b6d66523 (patch)
tree5575782a6aa8c5704aa78fded190f041d442833e
parent6f3983ee29091c324e06c545bb1f2951cbe8e251 (diff)
mpu9250: store current fsr setting after change
-rw-r--r--src/driver/mpu9250.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/driver/mpu9250.cc b/src/driver/mpu9250.cc
index e34a4a7..bef086f 100644
--- a/src/driver/mpu9250.cc
+++ b/src/driver/mpu9250.cc
@@ -89,6 +89,7 @@ void MPU9250::setGyroFSR(MPU9250::gyro_fsr_e fsr)
txbuf[0] = MPU9250_GYRO_CONFIG;
txbuf[1] = fsr << GYRO_CONFIG_GYRO_FS_SEL;
i2c.xmit(address, 2, txbuf, 0, rxbuf);
+ gyro_fsr = fsr;
}
void MPU9250::setAccelFSR(MPU9250::accel_fsr_e fsr)
@@ -96,6 +97,7 @@ void MPU9250::setAccelFSR(MPU9250::accel_fsr_e fsr)
txbuf[0] = MPU9250_ACCEL_CONFIG;
txbuf[1] = fsr << ACCEL_CONFIG_ACCEL_FS_SEL;
i2c.xmit(address, 2, txbuf, 0, rxbuf);
+ accel_fsr = fsr;
}
void MPU9250::AGSleep()