From d40fb96fcf6b7415c445df036641ebd1fa00e55c Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Mon, 31 Jan 2011 22:08:37 -0800 Subject: Added set prescaler and set repetition counter functions to timer. --- examples/stm32/stm32-h103/pwm_6step/pwm_6step.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'examples/stm32/stm32-h103') 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); -- cgit v1.2.3