Fix 32KHz gyro targetLooptime calculation
The target loop time was being calculated incorrectly for 32KHz gyros. Constant shoud be 31.25 rather than 31.5.
This commit is contained in:
parent
f4011b3dc3
commit
359290d1df
|
@ -54,7 +54,7 @@ uint32_t gyroSetSampleRate(gyroDev_t *gyro, uint8_t lpf, uint8_t gyroSyncDenomin
|
||||||
if (lpf == GYRO_HARDWARE_LPF_NORMAL || lpf == GYRO_HARDWARE_LPF_EXPERIMENTAL) {
|
if (lpf == GYRO_HARDWARE_LPF_NORMAL || lpf == GYRO_HARDWARE_LPF_EXPERIMENTAL) {
|
||||||
if (gyro_use_32khz) {
|
if (gyro_use_32khz) {
|
||||||
gyro->gyroRateKHz = GYRO_RATE_32_kHz;
|
gyro->gyroRateKHz = GYRO_RATE_32_kHz;
|
||||||
gyroSamplePeriod = 31.5f;
|
gyroSamplePeriod = 31.25f;
|
||||||
} else {
|
} else {
|
||||||
switch (gyro->mpuDetectionResult.sensor) {
|
switch (gyro->mpuDetectionResult.sensor) {
|
||||||
case BMI_160_SPI:
|
case BMI_160_SPI:
|
||||||
|
|
Loading…
Reference in New Issue