From d7489ebfbd0798c804ed3d7073040cedaea38d26 Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Thu, 4 Mar 2010 20:37:04 +0100 Subject: Added standard clock setup routines. Thanks to Thomas Otto for pointing out problems with the clock code in examples and his clock routine implementations. Based on that the most common clock combination routines were added to the library and all routines in examples setting up the clock replaced with calls to that functions. --- examples/stm32-h103/spi/spi.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'examples/stm32-h103/spi') diff --git a/examples/stm32-h103/spi/spi.c b/examples/stm32-h103/spi/spi.c index bf313be..57ac47e 100644 --- a/examples/stm32-h103/spi/spi.c +++ b/examples/stm32-h103/spi/spi.c @@ -21,23 +21,7 @@ void clock_setup(void) { - /* Select HSI as SYSCLK source. */ - rcc_set_sysclk_source(SW_SYSCLKSEL_HSICLK); - - /* Set the PLL multiplication factor to 9. */ - rcc_set_pll_multiplication_factor(PLLMUL_PLL_CLK_MUL9); - - /* Select HSI/2 as PLL source. */ - rcc_set_pll_source(PLLSRC_HSI_CLK_DIV2); - - rcc_set_pllxtpre(PLLXTPRE_HSE_CLK_DIV2); - - /* Enable PLL oscillator and wait for it to stabilize. */ - rcc_osc_on(PLL); - rcc_wait_for_osc_ready(PLL); - - /* Select PLL as SYSCLK source. */ - rcc_set_sysclk_source(SW_SYSCLKSEL_PLLCLK); + rcc_clock_setup_in_hse_8mhz_out_72mhz(); } void spi_setup(void) -- cgit v1.2.3