Disable use_unsynced_pwm if using DSHOT or PROSHOT

The digital protocols are always synchronized to the PID loop. People are setting the `use_unsynced_pwm` option mistakingly thinking it has some effect and using that to perpetuate misinformation.
This commit is contained in:
Bruce Luckcuck 2019-06-26 09:30:56 -04:00
parent ecb67fcc09
commit 73033e185d
1 changed files with 9 additions and 2 deletions

View File

@ -452,7 +452,7 @@ static void validateAndFixConfig(void)
#endif
#endif
#if defined(USE_DSHOT_TELEMETRY)
#if defined(USE_DSHOT)
bool usingDshotProtocol;
switch (motorConfig()->dev.motorPwmProtocol) {
case PWM_TYPE_PROSHOT1000:
@ -467,11 +467,18 @@ static void validateAndFixConfig(void)
break;
}
// If using DSHOT protocol disable unsynched PWM as it's meaningless
if (usingDshotProtocol) {
motorConfigMutable()->dev.useUnsyncedPwm = false;
}
#if defined(USE_DSHOT_TELEMETRY)
if ((!usingDshotProtocol || motorConfig()->dev.useBurstDshot || !systemConfig()->schedulerOptimizeRate)
&& motorConfig()->dev.useDshotTelemetry) {
motorConfigMutable()->dev.useDshotTelemetry = false;
}
#endif
#endif // USE_DSHOT_TELEMETRY
#endif // USE_DSHOT
// Temporary workaround until RPM Filter supports dual-gyro using both sensors
// Once support is added remove this block