diff options
author | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-05-26 11:24:55 +0000 |
---|---|---|
committer | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-05-26 11:24:55 +0000 |
commit | 61d215fb3ddf88f78077ac780401613da85f44d7 (patch) | |
tree | 540c119472625d2ed6c430dcca523fa203b0ce8f | |
parent | 5e34b6470aa28f99b4274b09d3eed358ecce7fb3 (diff) | |
download | ChibiOS-61d215fb3ddf88f78077ac780401613da85f44d7.tar.gz ChibiOS-61d215fb3ddf88f78077ac780401613da85f44d7.tar.bz2 ChibiOS-61d215fb3ddf88f78077ac780401613da85f44d7.zip |
Enforced HSE related checks in STM32F4xx hal_lld
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9533 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/ports/STM32/STM32F4xx/hal_lld.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/STM32F4xx/hal_lld.h b/os/hal/ports/STM32/STM32F4xx/hal_lld.h index 3f9e0edb2..337b8a052 100644 --- a/os/hal/ports/STM32/STM32F4xx/hal_lld.h +++ b/os/hal/ports/STM32/STM32F4xx/hal_lld.h @@ -1075,10 +1075,17 @@ #if STM32_HSECLK == 0
#error "HSE frequency not defined"
-#elif (STM32_HSECLK < STM32_HSECLK_MIN) || (STM32_HSECLK > STM32_HSECLK_MAX)
+#else /* STM32_HSECLK != 0 */
+#if defined(STM32_HSE_BYPASS)
+#if (STM32_HSECLK < STM32_HSECLK_MIN) || (STM32_HSECLK > STM32_HSECLK_BYP_MAX)
+#error "STM32_HSECLK outside acceptable range (STM32_HSECLK_MIN...STM32_HSECLK_BYP_MAX)"
+#endif
+#else /* !defined(STM32_HSE_BYPASS) */
+#if (STM32_HSECLK < STM32_HSECLK_MIN) || (STM32_HSECLK > STM32_HSECLK_MAX)
#error "STM32_HSECLK outside acceptable range (STM32_HSECLK_MIN...STM32_HSECLK_MAX)"
#endif
-
+#endif /* !defined(STM32_HSE_BYPASS) */
+#endif /* STM32_HSECLK != 0 */
#else /* !STM32_HSE_ENABLED */
#if STM32_SW == STM32_SW_HSE
|