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:
Karl Palsson
2016-12-14 15:15:17 +00:00
committed by Karl Palsson
parent 833da68c18
commit 1260b16772
11 changed files with 12 additions and 11 deletions

View File

@@ -54,7 +54,7 @@ static void timer_setup(void)
{
/* Enable TIM2 clock. */
rcc_periph_clock_enable(RCC_TIM2);
timer_reset(TIM2);
rcc_periph_reset_pulse(RST_TIM2);
/* Timer global mode: - No divider, Alignment edge, Direction up */
timer_set_mode(TIM2, TIM_CR1_CKD_CK_INT,
TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP);

View File

@@ -81,7 +81,7 @@ static void tim_setup(void)
nvic_enable_irq(NVIC_TIM2_IRQ);
/* Reset TIM2 peripheral. */
timer_reset(TIM2);
rcc_periph_reset_pulse(RST_TIM2);
/* Timer global mode:
* - No divider

View File

@@ -55,7 +55,7 @@ static void timer_setup(void)
{
/* Enable TIM2 clock. */
rcc_periph_clock_enable(RCC_TIM2);
timer_reset(TIM2);
rcc_periph_reset_pulse(RST_TIM2);
/* Timer global mode: - No divider, Alignment edge, Direction up */
timer_set_mode(TIM2, TIM_CR1_CKD_CK_INT,
TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP);