diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-06-01 07:26:00 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-06-01 07:26:00 +0000 |
commit | 27255085451758a0f802ee420694cf00f61c674b (patch) | |
tree | c05665f708ab5d068495ea0cf4f05e130d96177b /os/hal/ports/STM32 | |
parent | bc6b6552fe403b4af4dc36d619cb18b4ea5edaef (diff) | |
download | ChibiOS-27255085451758a0f802ee420694cf00f61c674b.tar.gz ChibiOS-27255085451758a0f802ee420694cf00f61c674b.tar.bz2 ChibiOS-27255085451758a0f802ee420694cf00f61c674b.zip |
Smarter checks for STM32F37x ADC/SDADC clocks.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12060 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r-- | os/hal/ports/STM32/STM32F37x/hal_lld.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/os/hal/ports/STM32/STM32F37x/hal_lld.h b/os/hal/ports/STM32/STM32F37x/hal_lld.h index c912adfb1..1da524c3c 100644 --- a/os/hal/ports/STM32/STM32F37x/hal_lld.h +++ b/os/hal/ports/STM32/STM32F37x/hal_lld.h @@ -804,12 +804,12 @@ #endif
/* ADC maximum frequency check.*/
-#if STM32_ADCCLK > STM32_ADCCLK_MAX
+#if STM32_ADC_USE_ADC1 && (STM32_ADCCLK > STM32_ADCCLK_MAX)
#error "STM32_ADCCLK exceeding maximum frequency (STM32_ADCCLK_MAX)"
#endif
/* ADC minimum frequency check.*/
-#if STM32_ADCCLK < STM32_ADCCLK_MIN
+#if STM32_ADC_USE_ADC1 && (STM32_ADCCLK < STM32_ADCCLK_MIN)
#error "STM32_ADCCLK exceeding minimum frequency (STM32_ADCCLK_MIN)"
#endif
@@ -853,12 +853,14 @@ #endif
/* SDADC maximum frequency check.*/
-#if STM32_SDADCCLK > STM32_SDADCCLK_FAST_MAX
+#if (STM32_ADC_USE_SDADC1 | STM32_ADC_USE_SDADC1 | STM32_ADC_USE_SDADC1) && \
+ (STM32_SDADCCLK > STM32_SDADCCLK_FAST_MAX)
#error "STM32_SDADCCLK exceeding maximum frequency (STM32_SDADCCLK_FAST_MAX)"
#endif
/* SDADC minimum frequency check.*/
-#if STM32_SDADCCLK < STM32_SDADCCLK_MIN
+#if (STM32_ADC_USE_SDADC1 | STM32_ADC_USE_SDADC1 | STM32_ADC_USE_SDADC1) && \
+ (STM32_SDADCCLK < STM32_SDADCCLK_MIN)
#error "STM32_SDADCCLK exceeding maximum frequency (STM32_SDADCCLK_MIN)"
#endif
|