From ccf7ce964a0ad6bba3765d173c6777eafece1090 Mon Sep 17 00:00:00 2001 From: Thorsten Laux Date: Fri, 6 Sep 2019 16:43:57 +0200 Subject: [PATCH] use driver independent motor count --- src/main/drivers/dshot_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/drivers/dshot_command.c b/src/main/drivers/dshot_command.c index d83b45a6f5..83630724fa 100644 --- a/src/main/drivers/dshot_command.c +++ b/src/main/drivers/dshot_command.c @@ -210,7 +210,7 @@ void dshotCommandWrite(uint8_t index, uint8_t motorCount, uint8_t command, bool if (commandControl) { commandControl->repeats = repeats; commandControl->delayAfterCommandUs = delayAfterCommandUs; - for (unsigned i = 0; i < dshotPwmDevice.count; i++) { + for (unsigned i = 0; i < motorCount; i++) { if (index == i || index == ALL_MOTORS) { commandControl->command[i] = command; } else {