1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Enable full 1khz sampling on F1 boards (no acc mode)

This commit is contained in:
borisbstyle 2015-08-07 13:37:34 +02:00
parent de5f6aa68f
commit 6f3afb2df1

View file

@ -52,15 +52,15 @@ void gyroUpdateSampleRate(uint32_t looptime, uint8_t lpf) {
gyroSamplePeriod = 125;
if(!sensors(SENSOR_ACC)) {
minLooptime = 500; // Max refresh 2khz
minLooptime = 500; // Max refresh 2khz
}
else {
minLooptime = 625; // Max refresh 1,6khz
minLooptime = 625; // Max refresh 1,6khz
}
}
else {
gyroSamplePeriod = 1000;
minLooptime = 1000;
minLooptime = 1000; // Full sampling
}
#elif STM32F10X
if (lpf == INV_FILTER_256HZ_NOLPF2) {
@ -75,7 +75,12 @@ void gyroUpdateSampleRate(uint32_t looptime, uint8_t lpf) {
}
else {
gyroSamplePeriod = 1000;
minLooptime = 2000;
if(!sensors(SENSOR_ACC)) {
minLooptime = 1000; // Full sampling without ACC
}
else {
minLooptime = 2000;
}
}
#endif
looptime = constrain(looptime, minLooptime, 4000);