mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 07:15:18 +03:00
New defaults auto looptime settings
This commit is contained in:
parent
bc2627b48f
commit
35ce724a22
2 changed files with 11 additions and 5 deletions
|
@ -117,11 +117,16 @@ void setGyroSamplingSpeed(uint16_t looptime) {
|
||||||
masterConfig.acc_hardware = 0;
|
masterConfig.acc_hardware = 0;
|
||||||
masterConfig.baro_hardware = 0;
|
masterConfig.baro_hardware = 0;
|
||||||
masterConfig.mag_hardware = 0;
|
masterConfig.mag_hardware = 0;
|
||||||
if (looptime < 375) {
|
if (looptime < 250) {
|
||||||
masterConfig.acc_hardware = 1;
|
masterConfig.acc_hardware = 1;
|
||||||
masterConfig.baro_hardware = 1;
|
masterConfig.baro_hardware = 1;
|
||||||
masterConfig.mag_hardware = 1;
|
masterConfig.mag_hardware = 1;
|
||||||
masterConfig.pid_process_denom = 2;
|
masterConfig.pid_process_denom = 2;
|
||||||
|
} else if (looptime < 375) {
|
||||||
|
masterConfig.acc_hardware = 0;
|
||||||
|
masterConfig.baro_hardware = 0;
|
||||||
|
masterConfig.mag_hardware = 0;
|
||||||
|
masterConfig.pid_process_denom = 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
masterConfig.gyro_lpf = 1;
|
masterConfig.gyro_lpf = 1;
|
||||||
|
@ -150,7 +155,9 @@ void setGyroSamplingSpeed(uint16_t looptime) {
|
||||||
} else {
|
} else {
|
||||||
masterConfig.pid_process_denom = 2;
|
masterConfig.pid_process_denom = 2;
|
||||||
}
|
}
|
||||||
|
#ifndef CC3D
|
||||||
masterConfig.emf_avoidance = 1;
|
masterConfig.emf_avoidance = 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
masterConfig.gyro_lpf = 1;
|
masterConfig.gyro_lpf = 1;
|
||||||
|
|
|
@ -670,13 +670,12 @@ int main(void) {
|
||||||
setTaskEnabled(TASK_ACCEL, true);
|
setTaskEnabled(TASK_ACCEL, true);
|
||||||
switch(targetLooptime) {
|
switch(targetLooptime) {
|
||||||
case(500):
|
case(500):
|
||||||
accTargetLooptime = 10000;
|
accTargetLooptime = 5000;
|
||||||
break;
|
break;
|
||||||
case(375):
|
case(375):
|
||||||
accTargetLooptime = 20000;
|
|
||||||
break;
|
|
||||||
case(250):
|
case(250):
|
||||||
accTargetLooptime = 30000;
|
case(125):
|
||||||
|
accTargetLooptime = 10000;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case(1000):
|
case(1000):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue