AP_GyroFFT: reduce first_harmonic scope

This commit is contained in:
Pierre Kancir 2021-08-13 10:16:38 +02:00 committed by Peter Barker
parent 92b179e0f3
commit 39fd32aa9e
1 changed files with 1 additions and 1 deletions

View File

@ -259,8 +259,8 @@ void AP_GyroFFT::init(uint32_t target_looptime_us)
// calculate harmonic multiplier. this assumes the harmonics configured on the
// harmonic notch reflect the multiples of the fundamental harmonic that should be tracked
uint8_t first_harmonic = 0;
if (_harmonic_fit > 0) {
uint8_t first_harmonic = 0;
for (uint8_t i = 0; i < HNF_MAX_HARMONICS; i++) {
if (_ins->get_gyro_harmonic_notch_harmonics() & (1<<i)) {
if (first_harmonic == 0) {