mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Ignore ACC sensor when setting looptime
IMU uses quaternions instead of euler (ACC speedup). Faster trigonio & math functions activated.
This commit is contained in:
parent
47afa51bd7
commit
0275129c23
1 changed files with 2 additions and 12 deletions
|
@ -90,20 +90,10 @@ void gyroUpdateSampleRate(uint32_t looptime, uint8_t lpf, uint8_t syncGyroToLoop
|
||||||
#else
|
#else
|
||||||
if (lpf == INV_FILTER_256HZ_NOLPF2) {
|
if (lpf == INV_FILTER_256HZ_NOLPF2) {
|
||||||
gyroSamplePeriod = 125;
|
gyroSamplePeriod = 125;
|
||||||
|
|
||||||
if(!sensors(SENSOR_ACC)) {
|
|
||||||
minLooptime = 625; // Max refresh 1,6khz
|
minLooptime = 625; // Max refresh 1,6khz
|
||||||
} else {
|
|
||||||
minLooptime = 1625; // Max refresh 615hz
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
gyroSamplePeriod = 1000;
|
gyroSamplePeriod = 1000;
|
||||||
|
|
||||||
if(!sensors(SENSOR_ACC)) {
|
|
||||||
minLooptime = 1000; // Full sampling without ACC
|
minLooptime = 1000; // Full sampling without ACC
|
||||||
} else {
|
|
||||||
minLooptime = 2000;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
looptime = constrain(looptime, minLooptime, 4000);
|
looptime = constrain(looptime, minLooptime, 4000);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue