aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2019-01-19 08:28:49 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2019-01-19 08:28:49 +0000
commitdd2092cec624604f4c019a621e11576054451e61 (patch)
treec60ae5f3a66942d34e05de1fbe2a7574b9db0634 /os
parent47578d38c5424db7de86beb575e333bbd1054133 (diff)
downloadChibiOS-dd2092cec624604f4c019a621e11576054451e61.tar.gz
ChibiOS-dd2092cec624604f4c019a621e11576054451e61.tar.bz2
ChibiOS-dd2092cec624604f4c019a621e11576054451e61.zip
Fixed bug #1002.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12547 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/STM32/STM32F4xx/hal_lld.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/STM32F4xx/hal_lld.h b/os/hal/ports/STM32/STM32F4xx/hal_lld.h
index 87061fe7d..cc5f1ee7b 100644
--- a/os/hal/ports/STM32/STM32F4xx/hal_lld.h
+++ b/os/hal/ports/STM32/STM32F4xx/hal_lld.h
@@ -204,20 +204,40 @@
* @brief Clock of timers connected to APB1
* (Timers 2, 3, 4, 5, 6, 7, 12, 13, 14).
*/
+#if !defined(STM32F446xx) || defined(__DOXYGEN__)
#if (STM32_PPRE1 == STM32_PPRE1_DIV1) || defined(__DOXYGEN__)
#define STM32_TIMCLK1 (STM32_PCLK1 * 1)
#else
#define STM32_TIMCLK1 (STM32_PCLK1 * 2)
#endif
+#else /* defined(STM32F446xx) */
+#if STM32_PPRE1 == STM32_PPRE1_DIV1
+#define STM32_TIMCLK1 (STM32_PCLK1 * 1)
+#elif STM32_PPRE1 == STM32_PPRE1_DIV2
+#define STM32_TIMCLK1 (STM32_PCLK1 * 2)
+#else
+#define STM32_TIMCLK1 (STM32_PCLK1 * 4)
+#endif
+#endif /* defined(STM32F446xx) */
/**
* @brief Clock of timers connected to APB2 (Timers 1, 8, 9, 10, 11).
*/
+#if !defined(STM32F446xx) || defined(__DOXYGEN__)
#if (STM32_PPRE2 == STM32_PPRE2_DIV1) || defined(__DOXYGEN__)
#define STM32_TIMCLK2 (STM32_PCLK2 * 1)
#else
#define STM32_TIMCLK2 (STM32_PCLK2 * 2)
#endif
+#else /* defined(STM32F446xx) */
+#if STM32_PPRE2 == STM32_PPRE2_DIV1
+#define STM32_TIMCLK2 (STM32_PCLK2 * 1)
+#elif STM32_PPRE2 == STM32_PPRE2_DIV2
+#define STM32_TIMCLK2 (STM32_PCLK2 * 2)
+#else
+#define STM32_TIMCLK2 (STM32_PCLK2 * 4)
+#endif
+#endif /* defined(STM32F446xx) */
#else /* STM32_HAS_RCC_DCKCFGR && (STM32_TIMPRE == STM32_TIMPRE_HCLK) */
#if (STM32_PPRE1 == STM32_PPRE1_DIV1) || \