1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Disable use_unsynced_pwm if using DSHOT or PROSHOT (#8486)

Disable use_unsynced_pwm if using DSHOT or PROSHOT
This commit is contained in:
Michael Keller 2019-06-28 09:36:12 +12:00 committed by GitHub
commit f21745c552
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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