Added set prescaler and set repetition counter functions to timer.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user