AP_Vehicle: removed num_dynamic_notches limit in dynamic harmonic

use INS_MAX_NOTCHES instead, allowing for more ESCs to be added by lua
scripts
This commit is contained in:
Andrew Tridgell 2022-08-18 17:20:58 +10:00
parent 5d29027025
commit 7f990ee7e1
1 changed files with 1 additions and 1 deletions

View File

@ -515,8 +515,8 @@ void AP_Vehicle::update_dynamic_notch(AP_InertialSensor::HarmonicNotch &notch)
// set the harmonic notch filter frequency scaled on measured frequency
if (notch.params.hasOption(HarmonicNotchFilterParams::Options::DynamicHarmonic)) {
float notches[INS_MAX_NOTCHES];
const uint8_t num_notches = AP::esc_telem().get_motor_frequencies_hz(notch.num_dynamic_notches, notches);
// ESC telemetry will return 0 for missing data, but only after 1s
const uint8_t num_notches = AP::esc_telem().get_motor_frequencies_hz(INS_MAX_NOTCHES, notches);
for (uint8_t i = 0; i < num_notches; i++) {
if (!is_zero(notches[i])) {
notches[i] = MAX(ref_freq, notches[i]);