Merge pull request #3679 from jflyper/bfdev-16G-fullscale-for-spi-mpu6000-and-mpu9250
Fighting against gravity: Configurator shows twice the gravity for MPU6000 and MPU9250
This commit is contained in:
commit
869dd1f00e
|
@ -738,7 +738,17 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
|
|||
case MSP_RAW_IMU:
|
||||
{
|
||||
// Hack scale due to choice of units for sensor data in multiwii
|
||||
const uint8_t scale = (acc.dev.acc_1G > 512) ? 4 : 1;
|
||||
|
||||
uint8_t scale;
|
||||
|
||||
if (acc.dev.acc_1G > 512*4) {
|
||||
scale = 8;
|
||||
} else if (acc.dev.acc_1G >= 512) {
|
||||
scale = 4;
|
||||
} else {
|
||||
scale = 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
sbufWriteU16(dst, acc.accSmooth[i] / scale);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue