mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 04:45:24 +03:00
Remove duplicate code from MSP_RAW_IMU. Saves a ~24 bytes of flash
space and results in easier to read code due to less nesting.
This commit is contained in:
parent
4fcecbd667
commit
26e950b433
1 changed files with 5 additions and 8 deletions
|
@ -812,14 +812,11 @@ static bool processOutCommand(uint8_t cmdMSP)
|
||||||
break;
|
break;
|
||||||
case MSP_RAW_IMU:
|
case MSP_RAW_IMU:
|
||||||
headSerialReply(18);
|
headSerialReply(18);
|
||||||
// Hack due to choice of units for sensor data in multiwii
|
// Hack scale due to choice of units for sensor data in multiwii
|
||||||
if (acc_1G > 1024) {
|
uint8_t scale = acc_1G > 1024 ? 8 : 0;
|
||||||
for (i = 0; i < 3; i++)
|
|
||||||
serialize16(accSmooth[i] / 8);
|
for (i = 0; i < 3; i++)
|
||||||
} else {
|
serialize16(accSmooth[i] / scale);
|
||||||
for (i = 0; i < 3; i++)
|
|
||||||
serialize16(accSmooth[i]);
|
|
||||||
}
|
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
serialize16(gyroADC[i]);
|
serialize16(gyroADC[i]);
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue