use driver independent motor count

This commit is contained in:
Thorsten Laux 2019-09-06 16:43:57 +02:00
parent db66284567
commit ccf7ce964a
1 changed files with 1 additions and 1 deletions

View File

@ -210,7 +210,7 @@ void dshotCommandWrite(uint8_t index, uint8_t motorCount, uint8_t command, bool
if (commandControl) { if (commandControl) {
commandControl->repeats = repeats; commandControl->repeats = repeats;
commandControl->delayAfterCommandUs = delayAfterCommandUs; commandControl->delayAfterCommandUs = delayAfterCommandUs;
for (unsigned i = 0; i < dshotPwmDevice.count; i++) { for (unsigned i = 0; i < motorCount; i++) {
if (index == i || index == ALL_MOTORS) { if (index == i || index == ALL_MOTORS) {
commandControl->command[i] = command; commandControl->command[i] = command;
} else { } else {