mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +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;
|
||||
case MSP_RAW_IMU:
|
||||
headSerialReply(18);
|
||||
// Hack due to choice of units for sensor data in multiwii
|
||||
if (acc_1G > 1024) {
|
||||
for (i = 0; i < 3; i++)
|
||||
serialize16(accSmooth[i] / 8);
|
||||
} else {
|
||||
for (i = 0; i < 3; i++)
|
||||
serialize16(accSmooth[i]);
|
||||
}
|
||||
// Hack scale due to choice of units for sensor data in multiwii
|
||||
uint8_t scale = acc_1G > 1024 ? 8 : 0;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
serialize16(accSmooth[i] / scale);
|
||||
for (i = 0; i < 3; i++)
|
||||
serialize16(gyroADC[i]);
|
||||
for (i = 0; i < 3; i++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue