aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/stm32-h103
diff options
context:
space:
mode:
authorPiotr Esden-Tempski2011-01-31 22:08:37 -0800
committerPiotr Esden-Tempski2011-01-31 22:08:37 -0800
commitd40fb96fcf6b7415c445df036641ebd1fa00e55c (patch)
tree203e0a4f2c39022059a23925c5bfa8b6a79394f5 /examples/stm32/stm32-h103
parent92edc113f9825f333ea66e41e8fcdbeb45da9cd6 (diff)
Added set prescaler and set repetition counter functions to timer.
Diffstat (limited to 'examples/stm32/stm32-h103')
-rw-r--r--examples/stm32/stm32-h103/pwm_6step/pwm_6step.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/stm32/stm32-h103/pwm_6step/pwm_6step.c b/examples/stm32/stm32-h103/pwm_6step/pwm_6step.c
index 505b3c8..bda8ff7 100644
--- a/examples/stm32/stm32-h103/pwm_6step/pwm_6step.c
+++ b/examples/stm32/stm32-h103/pwm_6step/pwm_6step.c
@@ -124,9 +124,6 @@ void tim_setup(void)
/* Reset TIM1 peripheral */
timer_reset(TIM1);
- /* Clock division. */
- timer_set_clock_division(TIM1, TIM_CR1_CKD_CK_INT);
-
/* Timer global mode:
* - No divider
* - alignment edge
@@ -136,6 +133,12 @@ void tim_setup(void)
TIM_CR1_CMS_EDGE,
TIM_CR1_DIR_UP);
+ /* Reset prescaler value. */
+ timer_set_prescaler(TIM1, 0);
+
+ /* Reset repetition counter value. */
+ timer_set_repetition_counter(TIM1, 0);
+
/* Enable preload. */
timer_enable_preload(TIM1);