mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Change use_fast_pwm to forced_motor_pwm // New default fixed PWM rates
This commit is contained in:
parent
a5278740bd
commit
977fec408a
11 changed files with 24 additions and 20 deletions
|
@ -165,10 +165,14 @@ void setGyroSamplingSpeed(uint16_t looptime) {
|
|||
masterConfig.gyro_sync_denom = constrain(looptime / gyroSampleRate, 1, maxDivider);
|
||||
|
||||
if (looptime < 1000) {
|
||||
masterConfig.use_fast_pwm = 1;
|
||||
masterConfig.motor_pwm_rate = lrintf(1.0f / (gyroSampleRate * masterConfig.gyro_sync_denom * masterConfig.pid_process_denom * 0.000001f));
|
||||
masterConfig.force_motor_pwm_rate = 1;
|
||||
if (masterConfig.use_multiShot || masterConfig.use_oneshot42) {
|
||||
masterConfig.motor_pwm_rate = 4200;
|
||||
} else {
|
||||
masterConfig.motor_pwm_rate = 2700;
|
||||
}
|
||||
} else {
|
||||
masterConfig.use_fast_pwm = 0;
|
||||
masterConfig.force_motor_pwm_rate = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue