From f0e5363703e37c8aebf2f9f85e1b6873289940ed Mon Sep 17 00:00:00 2001 From: jflyper Date: Sun, 2 Jun 2019 21:32:03 +0900 Subject: [PATCH] Remove excess member from timerHardware_s --- src/main/drivers/pwm_output_dshot_hal_hal.c | 5 +++-- src/main/drivers/timer.h | 1 - src/main/drivers/timer_def.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/drivers/pwm_output_dshot_hal_hal.c b/src/main/drivers/pwm_output_dshot_hal_hal.c index c6199e7d2..de883e603 100644 --- a/src/main/drivers/pwm_output_dshot_hal_hal.c +++ b/src/main/drivers/pwm_output_dshot_hal_hal.c @@ -402,8 +402,9 @@ P - High - High - } else #endif { - dmaInit(timerHardware->dmaIrqHandler, OWNER_MOTOR, RESOURCE_INDEX(motorIndex)); - dmaSetHandler(timerHardware->dmaIrqHandler, motor_DMA_IRQHandler, NVIC_BUILD_PRIORITY(1, 2), motorIndex); + dmaIdentifier_e identifier = dmaGetIdentifier(timerHardware->dmaRef); + dmaInit(identifier, OWNER_MOTOR, RESOURCE_INDEX(motorIndex)); + dmaSetHandler(identifier, motor_DMA_IRQHandler, NVIC_BUILD_PRIORITY(1, 2), motorIndex); } // Start the timer channel now. diff --git a/src/main/drivers/timer.h b/src/main/drivers/timer.h index 73954a736..e749f74a7 100644 --- a/src/main/drivers/timer.h +++ b/src/main/drivers/timer.h @@ -127,7 +127,6 @@ typedef struct timerHardware_s { #elif defined(STM32H7) DMA_Stream_TypeDef *dmaRef; uint8_t dmaRequest; - uint8_t dmaIrqHandler; // XXX Should be gone (can be substituted by dmaGetIdentifier) #else DMA_Channel_TypeDef *dmaRef; #endif diff --git a/src/main/drivers/timer_def.h b/src/main/drivers/timer_def.h index 57b843c1c..f8ee9c5dc 100644 --- a/src/main/drivers/timer_def.h +++ b/src/main/drivers/timer_def.h @@ -723,8 +723,7 @@ DEF_TIM_AF(TCH_## tim ## _ ## chan, pin) \ DEF_TIM_DMA_COND(/* add comma */ , \ DEF_TIM_DMA_STREAM(dmaopt, TCH_## tim ## _ ## chan), \ - DEF_TIM_DMA_REQUEST(TCH_## tim ## _ ## chan), \ - DEF_TIM_DMA_HANDLER(dmaopt, TCH_## tim ## _ ## chan) \ + DEF_TIM_DMA_REQUEST(TCH_## tim ## _ ## chan) \ ) \ DEF_TIM_DMA_COND(/* add comma */ , \ DEF_TIM_DMA_STREAM(upopt, TCH_## tim ## _UP), \