Added check to disable bidirectional Dshot when N-channel timers are used.
This commit is contained in:
parent
864cf3f3b4
commit
1d555a6297
|
@ -1585,8 +1585,7 @@ static void cliSerialPassthrough(const char *cmdName, char *cmdline)
|
|||
// pwmDisableMotors();
|
||||
motorDisable();
|
||||
delay(5);
|
||||
unsigned motorsCount = getMotorCount();
|
||||
for (unsigned i = 0; i < motorsCount; i++) {
|
||||
for (unsigned i = 0; i < getMotorCount(); i++) {
|
||||
const ioTag_t tag = motorConfig()->dev.ioTags[i];
|
||||
if (tag) {
|
||||
const timerHardware_t *timerHardware = timerGetByTag(tag);
|
||||
|
|
|
@ -506,8 +506,20 @@ static void validateAndFixConfig(void)
|
|||
}
|
||||
|
||||
#if defined(USE_DSHOT_TELEMETRY)
|
||||
if ((!configuredMotorProtocolDshot || (motorConfig()->dev.useDshotBitbang == DSHOT_BITBANG_OFF && motorConfig()->dev.useBurstDshot == DSHOT_DMAR_ON) || systemConfig()->schedulerOptimizeRate == SCHEDULER_OPTIMIZE_RATE_OFF)
|
||||
&& motorConfig()->dev.useDshotTelemetry) {
|
||||
bool nChannelTimerUsed = false;
|
||||
for (unsigned i = 0; i < getMotorCount(); i++) {
|
||||
const ioTag_t tag = motorConfig()->dev.ioTags[i];
|
||||
if (tag) {
|
||||
const timerHardware_t *timer = timerGetByTag(tag);
|
||||
if (timer && timer->output & TIMER_OUTPUT_N_CHANNEL) {
|
||||
nChannelTimerUsed = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((!configuredMotorProtocolDshot || (motorConfig()->dev.useDshotBitbang == DSHOT_BITBANG_OFF && (motorConfig()->dev.useBurstDshot == DSHOT_DMAR_ON || nChannelTimerUsed)) || systemConfig()->schedulerOptimizeRate == SCHEDULER_OPTIMIZE_RATE_OFF) && motorConfig()->dev.useDshotTelemetry) {
|
||||
motorConfigMutable()->dev.useDshotTelemetry = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue