Merge pull request #7795 from etracer65/dshot_bidir_protocol_check
Disable DSHOT Telemetry if motor protocol is not DSHOT or PROSHOT
This commit is contained in:
commit
4c62d362ee
|
@ -441,7 +441,21 @@ static void validateAndFixConfig(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_DSHOT_TELEMETRY)
|
#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) {
|
&& motorConfig()->dev.useDshotTelemetry) {
|
||||||
motorConfigMutable()->dev.useDshotTelemetry = false;
|
motorConfigMutable()->dev.useDshotTelemetry = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue