From 60e035be073ee5a065bb7201938909d6506279cc Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Mon, 1 Nov 2021 02:51:38 +1300 Subject: [PATCH] Fixed burst Dshot. --- src/main/drivers/pwm_output_dshot.c | 8 ++++---- src/main/drivers/pwm_output_dshot_hal.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/drivers/pwm_output_dshot.c b/src/main/drivers/pwm_output_dshot.c index 21c58b8b7c..3ea1f46472 100644 --- a/src/main/drivers/pwm_output_dshot.c +++ b/src/main/drivers/pwm_output_dshot.c @@ -363,10 +363,10 @@ bool pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m motor->timer->timerDmaSources &= ~motor->timerDmaSource; } - if (!dmaIsConfigured) { - xDMA_Cmd(dmaRef, DISABLE); - xDMA_DeInit(dmaRef); + xDMA_Cmd(dmaRef, DISABLE); + xDMA_DeInit(dmaRef); + if (!dmaIsConfigured) { dmaEnable(dmaIdentifier); } @@ -438,7 +438,7 @@ bool pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m #ifdef USE_DSHOT_DMAR if (useBurstDshot) { if (!dmaIsConfigured) { - dmaSetHandler(dmaIdentifier, motor_DMA_IRQHandler, NVIC_PRIO_DSHOT_DMA, timerIndex); + dmaSetHandler(dmaIdentifier, motor_DMA_IRQHandler, NVIC_PRIO_DSHOT_DMA, motor->index); } } else #endif diff --git a/src/main/drivers/pwm_output_dshot_hal.c b/src/main/drivers/pwm_output_dshot_hal.c index 63c74fc89a..e7fac23c05 100644 --- a/src/main/drivers/pwm_output_dshot_hal.c +++ b/src/main/drivers/pwm_output_dshot_hal.c @@ -419,7 +419,7 @@ bool pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m #ifdef USE_DSHOT_DMAR if (useBurstDshot) { if (!dmaIsConfigured) { - dmaSetHandler(dmaIdentifier, motor_DMA_IRQHandler, NVIC_PRIO_DSHOT_DMA, timerIndex); + dmaSetHandler(dmaIdentifier, motor_DMA_IRQHandler, NVIC_PRIO_DSHOT_DMA, motor->index); } } else #endif