mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 14:47:44 +08:00
Fix mixer issue with undefined return in callback and non value initialized variables.
This commit is contained in:
@@ -384,6 +384,8 @@ mixer_callback(uintptr_t handle,
|
||||
uint8_t control_index,
|
||||
float &control)
|
||||
{
|
||||
control = 0.0f;
|
||||
|
||||
if (control_group >= PX4IO_CONTROL_GROUPS) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ SimpleMixer::mix(float *outputs, unsigned space)
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < _pinfo->control_count; i++) {
|
||||
float input;
|
||||
float input = 0.0f;
|
||||
|
||||
_control_cb(_cb_handle,
|
||||
_pinfo->controls[i].control_group,
|
||||
|
||||
@@ -590,6 +590,7 @@ bool MixerTest::mixerTest()
|
||||
static int
|
||||
mixer_callback(uintptr_t handle, uint8_t control_group, uint8_t control_index, float &control)
|
||||
{
|
||||
control = 0.0f;
|
||||
if (control_group != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user