mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
Fix 1000 looptime auto config
This commit is contained in:
parent
dc6529ec9e
commit
37bd1d65fd
1 changed files with 3 additions and 2 deletions
|
@ -132,10 +132,10 @@ void setGyroSamplingSpeed(uint16_t looptime) {
|
||||||
masterConfig.mag_hardware = 1;
|
masterConfig.mag_hardware = 1;
|
||||||
masterConfig.pid_process_denom = 2;
|
masterConfig.pid_process_denom = 2;
|
||||||
}
|
}
|
||||||
|
masterConfig.gyro_sync_denom = constrain(looptime / gyroSampleRate, 1, maxDivider);
|
||||||
} else {
|
} else {
|
||||||
masterConfig.gyro_lpf = 0;
|
masterConfig.gyro_lpf = 0;
|
||||||
masterConfig.gyro_sync_denom = 8;
|
masterConfig.gyro_sync_denom = 8;
|
||||||
masterConfig.pid_process_denom = 1;
|
|
||||||
masterConfig.acc_hardware = 0;
|
masterConfig.acc_hardware = 0;
|
||||||
masterConfig.baro_hardware = 0;
|
masterConfig.baro_hardware = 0;
|
||||||
masterConfig.mag_hardware = 0;
|
masterConfig.mag_hardware = 0;
|
||||||
|
@ -159,8 +159,10 @@ void setGyroSamplingSpeed(uint16_t looptime) {
|
||||||
masterConfig.pid_process_denom = 2;
|
masterConfig.pid_process_denom = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
masterConfig.gyro_sync_denom = constrain(looptime / gyroSampleRate, 1, maxDivider);
|
||||||
} else {
|
} else {
|
||||||
masterConfig.gyro_lpf = 0;
|
masterConfig.gyro_lpf = 0;
|
||||||
|
|
||||||
masterConfig.gyro_sync_denom = 8;
|
masterConfig.gyro_sync_denom = 8;
|
||||||
masterConfig.acc_hardware = 0;
|
masterConfig.acc_hardware = 0;
|
||||||
masterConfig.baro_hardware = 0;
|
masterConfig.baro_hardware = 0;
|
||||||
|
@ -168,7 +170,6 @@ void setGyroSamplingSpeed(uint16_t looptime) {
|
||||||
masterConfig.pid_process_denom = 1;
|
masterConfig.pid_process_denom = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
masterConfig.gyro_sync_denom = constrain(looptime / gyroSampleRate, 1, maxDivider);
|
|
||||||
|
|
||||||
if (!(masterConfig.use_multiShot || masterConfig.use_oneshot42) && ((masterConfig.gyro_sync_denom * gyroSampleRate) == 125)) masterConfig.pid_process_denom = 3;
|
if (!(masterConfig.use_multiShot || masterConfig.use_oneshot42) && ((masterConfig.gyro_sync_denom * gyroSampleRate) == 125)) masterConfig.pid_process_denom = 3;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue