px4io: discover PWM_MAIN_TRIMx parameters right away

This commit is contained in:
Matthias Grob
2021-11-30 14:19:46 +01:00
committed by Daniel Agar
parent a9b9362fea
commit 89892d0d17
+5 -3
View File
@@ -916,7 +916,7 @@ void PX4IO::update_params()
}
// PWM_MAIN_TRIMx
if (_mixing_output.mixers()) {
{
int16_t values[8] {};
for (unsigned i = 0; i < _max_actuators; i++) {
@@ -928,8 +928,10 @@ void PX4IO::update_params()
}
}
// copy the trim values to the mixer offsets
_mixing_output.mixers()->set_trims(values, _max_actuators);
if (_mixing_output.mixers()) {
// copy the trim values to the mixer offsets
_mixing_output.mixers()->set_trims(values, _max_actuators);
}
}
}