Code: Select all
diff -rbu ChibiOS/os/hal/ports/STM32/LLD/TIMv1/st_lld.c ChibiOS_3.0.4/os/hal/ports/STM32/LLD/TIMv1/st_lld.c
--- ChibiOS/os/hal/ports/STM32/LLD/TIMv1/st_lld.c 2016-01-07 21:55:14.887402325 -0800
+++ ChibiOS_3.0.4/os/hal/ports/STM32/LLD/TIMv1/st_lld.c 2016-01-03 11:16:42.390374190 -0800
@@ -98,6 +98,21 @@
#define ST_ENABLE_STOP() DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_TIM5_STOP
#endif
+#elif STM32_ST_USE_TIMER == 14
+#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM14_IS_32BITS
+#error "TIM14 is not a 32bits timer"
+#endif
+
+#define ST_HANDLER STM32_TIM14_HANDLER
+#define ST_NUMBER STM32_TIM14_NUMBER
+#define ST_CLOCK_SRC STM32_TIMCLK1
+#define ST_ENABLE_CLOCK() rccEnableTIM14(FALSE)
+#if defined(STM32F1XX)
+#define ST_ENABLE_STOP() DBGMCU->CR |= DBGMCU_CR_DBG_TIM14_STOP
+#else
+#define ST_ENABLE_STOP() DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_TIM14_STOP
+#endif
+
#else
#error "STM32_ST_USE_TIMER specifies an unsupported timer"
#endif
diff -rbu ChibiOS/os/hal/ports/STM32/LLD/TIMv1/st_lld.h ChibiOS_3.0.4/os/hal/ports/STM32/LLD/TIMv1/st_lld.h
--- ChibiOS/os/hal/ports/STM32/LLD/TIMv1/st_lld.h 2016-01-07 21:55:14.887402325 -0800
+++ ChibiOS_3.0.4/os/hal/ports/STM32/LLD/TIMv1/st_lld.h 2016-01-03 11:16:28.418373846 -0800
@@ -89,6 +89,12 @@
#endif
#define STM32_ST_TIM STM32_TIM5
+#elif STM32_ST_USE_TIMER == 14
+#if !STM32_HAS_TIM14
+#error "TIM14 not present"
+#endif
+#define STM32_ST_TIM STM32_TIM14
+
#else
#error "STM32_ST_USE_TIMER specifies an unsupported timer"
#endif