mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 20:53:33 +08:00
fix(ci): clang-tidy bugprone-too-small-loop-variable(#26709)
This commit is contained in:
@@ -439,14 +439,14 @@ void GyroFFT::FindPeaks(const hrt_abstime ×tamp_sample, int axis, q15_t *ff
|
||||
float bin_mag_sum = 0;
|
||||
|
||||
// FFT output buffer is ordered [real[0], imag[0], real[1], imag[1], real[2], imag[2] ... real[(N/2)-1], imag[(N/2)-1]
|
||||
for (uint16_t fft_index = 2; fft_index < _imu_gyro_fft_len; fft_index += 2) {
|
||||
for (size_t fft_index = 2; fft_index < static_cast<size_t>(_imu_gyro_fft_len); fft_index += 2) {
|
||||
|
||||
const float real = fft_outupt_buffer[fft_index];
|
||||
const float imag = fft_outupt_buffer[fft_index + 1];
|
||||
|
||||
const float fft_magnitude = sqrtf(real * real + imag * imag);
|
||||
|
||||
int bin_index = fft_index / 2;
|
||||
size_t bin_index = fft_index / 2;
|
||||
|
||||
_peak_magnitudes_all[bin_index] = fft_magnitude;
|
||||
bin_mag_sum += fft_magnitude;
|
||||
|
||||
Reference in New Issue
Block a user