timer_reset -> rcc_periph_reset_pulse() replace
timer_reset wasn't fully implemented for all timers on all series, and was simply a wrapper of the RST bits in the RCC registers anyway. First part of https://github.com/libopencm3/libopencm3/issues/709
This commit is contained in:
committed by
Karl Palsson
parent
833da68c18
commit
1260b16772
@@ -70,7 +70,7 @@ static void timer_setup(void)
|
||||
rcc_periph_clock_enable(RCC_TIM2);
|
||||
|
||||
/* Time Base configuration */
|
||||
timer_reset(timer);
|
||||
rcc_periph_reset_pulse(RST_TIM2);
|
||||
timer_set_mode(timer, TIM_CR1_CKD_CK_INT,
|
||||
TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP);
|
||||
timer_set_period(timer, 0xFF);
|
||||
|
||||
@@ -73,7 +73,7 @@ static void timer_setup(void)
|
||||
rcc_periph_clock_enable(RCC_TIM2);
|
||||
|
||||
/* Time Base configuration */
|
||||
timer_reset(timer);
|
||||
rcc_periph_reset_pulse(RST_TIM2);
|
||||
timer_set_mode(timer, TIM_CR1_CKD_CK_INT,
|
||||
TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP);
|
||||
timer_set_period(timer, 0xFF);
|
||||
|
||||
@@ -81,7 +81,7 @@ static void timer_setup(void)
|
||||
rcc_periph_clock_enable(RCC_TIM2);
|
||||
|
||||
/* Time Base configuration */
|
||||
timer_reset(timer);
|
||||
rcc_periph_reset_pulse(RST_TIM2);
|
||||
timer_set_mode(timer, TIM_CR1_CKD_CK_INT,
|
||||
TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP);
|
||||
timer_set_period(timer, 0xFF);
|
||||
|
||||
Reference in New Issue
Block a user