From 4c86e31d1ea4f99ee7b383456a73f2a7f4bfa822 Mon Sep 17 00:00:00 2001 From: Flavio Pinzarrone <73338417+flaviopinzarrone@users.noreply.github.com> Date: Mon, 4 Dec 2023 16:50:08 +0100 Subject: [PATCH] Fixed incorrect accelerometer scaling in MSP (#13026) --- src/main/msp/msp.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/main/msp/msp.c b/src/main/msp/msp.c index 0024efa3e6..32766e2dc9 100644 --- a/src/main/msp/msp.c +++ b/src/main/msp/msp.c @@ -1132,24 +1132,10 @@ static bool mspProcessOutCommand(mspDescriptor_t srcDesc, int16_t cmdMSP, sbuf_t case MSP_RAW_IMU: { -#if defined(USE_ACC) - // Hack scale due to choice of units for sensor data in multiwii - - uint8_t scale; - if (acc.dev.acc_1G > 512 * 4) { - scale = 8; - } else if (acc.dev.acc_1G > 512 * 2) { - scale = 4; - } else if (acc.dev.acc_1G >= 512) { - scale = 2; - } else { - scale = 1; - } -#endif for (int i = 0; i < 3; i++) { #if defined(USE_ACC) - sbufWriteU16(dst, lrintf(acc.accADC[i] / scale)); + sbufWriteU16(dst, lrintf(acc.accADC[i])); #else sbufWriteU16(dst, 0); #endif