New defaults auto looptime settings

This commit is contained in:
borisbstyle 2016-02-27 00:36:32 +01:00
parent bc2627b48f
commit 35ce724a22
2 changed files with 11 additions and 5 deletions

View File

@ -117,11 +117,16 @@ void setGyroSamplingSpeed(uint16_t looptime) {
masterConfig.acc_hardware = 0;
masterConfig.baro_hardware = 0;
masterConfig.mag_hardware = 0;
if (looptime < 375) {
if (looptime < 250) {
masterConfig.acc_hardware = 1;
masterConfig.baro_hardware = 1;
masterConfig.mag_hardware = 1;
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 {
masterConfig.gyro_lpf = 1;
@ -150,7 +155,9 @@ void setGyroSamplingSpeed(uint16_t looptime) {
} else {
masterConfig.pid_process_denom = 2;
}
#ifndef CC3D
masterConfig.emf_avoidance = 1;
#endif
}
} else {
masterConfig.gyro_lpf = 1;

View File

@ -670,13 +670,12 @@ int main(void) {
setTaskEnabled(TASK_ACCEL, true);
switch(targetLooptime) {
case(500):
accTargetLooptime = 10000;
accTargetLooptime = 5000;
break;
case(375):
accTargetLooptime = 20000;
break;
case(250):
accTargetLooptime = 30000;
case(125):
accTargetLooptime = 10000;
break;
default:
case(1000):