Avoid a couple of unnecessary promotions to double.

This commit is contained in:
px4dev
2012-09-03 23:21:41 -07:00
parent 5c692e2971
commit 62682d805e
+2 -2
View File
@@ -141,7 +141,7 @@ MultirotorMixer::MultirotorMixer(ControlCallback control_cb,
_roll_scale(roll_scale),
_pitch_scale(pitch_scale),
_yaw_scale(yaw_scale),
_deadband(-1.0 + deadband), /* shift to output range here to avoid runtime calculation */
_deadband(-1.0f + deadband), /* shift to output range here to avoid runtime calculation */
_rotor_count(_config_rotor_count[geometry]),
_rotors(_config_index[geometry])
{
@@ -179,7 +179,7 @@ MultirotorMixer::mix(float *outputs, unsigned space)
fixup_scale = 2.0f;
}
for (unsigned i = 0; i < _rotor_count; i++)
outputs[i] = -1.0 + (outputs[i] * fixup_scale);
outputs[i] = -1.0f + (outputs[i] * fixup_scale);
/* ensure outputs are out of the deadband */
for (unsigned i = 0; i < _rotor_count; i++)