aboutsummaryrefslogtreecommitdiff
path: root/lib/stm32/timer.c
diff options
context:
space:
mode:
authorThomas Daede2012-10-31 15:34:10 -0500
committerThomas Daede2012-10-31 15:34:10 -0500
commit016c74af255e6989019f0a6c0a9d7e2e355f5735 (patch)
tree01862fb7ffeb066e166f7ae103951fe8844ec52c /lib/stm32/timer.c
parent94689337352002fa3dfb3dc14804c1f6d087750a (diff)
F2 timers are the same as F4 timers, so make the same changes to them
Diffstat (limited to 'lib/stm32/timer.c')
-rw-r--r--lib/stm32/timer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/stm32/timer.c b/lib/stm32/timer.c
index e6c51cf..a5cf99d 100644
--- a/lib/stm32/timer.c
+++ b/lib/stm32/timer.c
@@ -101,6 +101,7 @@ push-pull outputs where the PWM output will appear.
#if defined(STM32F1)
# include <libopencm3/stm32/f1/rcc.h>
#elif defined(STM32F2)
+# include <libopencm3/stm32/f2/timer.h>
# include <libopencm3/stm32/f2/rcc.h>
#elif defined(STM32F4)
# include <libopencm3/stm32/f4/timer.h>
@@ -1711,13 +1712,13 @@ u32 timer_get_counter(u32 timer_peripheral)
/** @brief Set Timer Option
Set timer options register on TIM2 or TIM5, used for oscillator calibration
-on TIM5 and trigger remapping on TIM2. Only available on F4.
+on TIM5 and trigger remapping on TIM2. Only available on F4 and F2.
@param[in] timer_peripheral Unsigned int32. Timer register address base
@returns Unsigned int32. Option flags.
*/
-#if (defined(STM32F4))
+#if (defined(STM32F4) || defined(STM32F2))
void timer_set_option(u32 timer_peripheral, u32 option)
{
if (timer_peripheral == TIM2) {