Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
deltaflight
deltaflight
Commits
26e950b4
Commit
26e950b4
authored
Jun 24, 2015
by
Dominic Clifton
Browse files
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.
parent
4fcecbd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/io/serial_msp.c
View file @
26e950b4
...
...
@@ -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
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment