From 72d05f682cf3fa7f2b9b5dea67989df0f7610f35 Mon Sep 17 00:00:00 2001 From: mikeller Date: Sat, 29 Jun 2019 19:43:15 +1200 Subject: [PATCH] Fixed build if none of USE_DSHOT, USE_LED_STRIP, USE_TRANSPONDER are defined. --- src/main/drivers/timer.h | 2 +- src/main/drivers/timer_def.h | 2 +- src/main/target/common_post.h | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/drivers/timer.h b/src/main/drivers/timer.h index ea3c0d326..ae0ea425e 100644 --- a/src/main/drivers/timer.h +++ b/src/main/drivers/timer.h @@ -112,7 +112,7 @@ typedef struct timerHardware_s { #if defined(STM32F3) || defined(STM32F4) || defined(STM32F7) || defined(STM32H7) uint8_t alternateFunction; #endif -#if defined(USE_DSHOT) || defined(USE_LED_STRIP) || defined(USE_TRANSPONDER) +#if defined(USE_TIMER_DMA) #if defined(USE_DMA_SPEC) #if defined(STM32F4) || defined(STM32F7) || defined(STM32H7) DMA_Stream_TypeDef *dmaRefConfigured; diff --git a/src/main/drivers/timer_def.h b/src/main/drivers/timer_def.h index 2178be5bc..65cc9a97e 100644 --- a/src/main/drivers/timer_def.h +++ b/src/main/drivers/timer_def.h @@ -24,7 +24,7 @@ #include "common/utils.h" // allow conditional definition of DMA related members -#if defined(USE_DSHOT) || defined(USE_LED_STRIP) || defined(USE_TRANSPONDER) +#if defined(USE_TIMER_DMA) # define DEF_TIM_DMA_COND(...) __VA_ARGS__ #else # define DEF_TIM_DMA_COND(...) diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index cff6451a8..45a6c10c3 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -310,6 +310,12 @@ #undef BEEPER_PWM_HZ #endif +#if defined(USE_DSHOT) || defined(USE_LED_STRIP) || defined(USE_TRANSPONDER) +#define USE_TIMER_DMA +#else +#undef USE_DMA_SPEC +#endif + #if !defined(USE_DMA_SPEC) #undef USE_TIMER_MGMT #endif