From b75ff2e2aecf5f9433573e8de3de06eabb9b02f5 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Fri, 14 Apr 2023 20:48:05 +0100 Subject: [PATCH] AP_HAL_ChibiOS: allow only ADC2 to be used --- libraries/AP_HAL_ChibiOS/hwdef/common/stm32h7_mcuconf.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/common/stm32h7_mcuconf.h b/libraries/AP_HAL_ChibiOS/hwdef/common/stm32h7_mcuconf.h index c447a9301b..b80a848e5e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/common/stm32h7_mcuconf.h +++ b/libraries/AP_HAL_ChibiOS/hwdef/common/stm32h7_mcuconf.h @@ -587,8 +587,11 @@ #define STM32_ADC_ADC3_CLOCK_MODE ADC_CCR_CKMODE_ADCCK // we call it ADC1 in hwdef.dat, but driver uses ADC12 for DMA stream +#ifdef STM32_ADC_ADC1_DMA_STREAM #define STM32_ADC_ADC12_DMA_STREAM STM32_ADC_ADC1_DMA_STREAM - +#elif defined(STM32_ADC_ADC2_DMA_STREAM) +#define STM32_ADC_ADC12_DMA_STREAM STM32_ADC_ADC2_DMA_STREAM +#endif /* * CAN driver system settings.