Skip to content

Commit

Permalink
Disable dshot_bidir if motor protocol is not DSHOT or PROSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
etracer65 committed Mar 15, 2019
1 parent 2db432a commit c82d0db
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/fc/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,21 @@ static void validateAndFixConfig(void)
#endif

#if defined(USE_DSHOT_TELEMETRY)
if ((motorConfig()->dev.useBurstDshot || !systemConfig()->schedulerOptimizeRate)
bool usingDshotProtocol;
switch (motorConfig()->dev.motorPwmProtocol) {
case PWM_TYPE_PROSHOT1000:
case PWM_TYPE_DSHOT1200:
case PWM_TYPE_DSHOT600:
case PWM_TYPE_DSHOT300:
case PWM_TYPE_DSHOT150:
usingDshotProtocol = true;
break;
default:
usingDshotProtocol = false;
break;
}

if ((!usingDshotProtocol || motorConfig()->dev.useBurstDshot || !systemConfig()->schedulerOptimizeRate)
&& motorConfig()->dev.useDshotTelemetry) {
motorConfigMutable()->dev.useDshotTelemetry = false;
}
Expand Down

0 comments on commit c82d0db

Please sign in to comment.