From e04f10e591e5d7386171c20dcc538475736211c7 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 29 Aug 2018 10:17:55 +0000 Subject: [PATCH] tests: gadget0: stm32f3: use library clock setups F3 rcc configs were overhauled and we can now use standard init code instead of specifying our own custom clock config. --- tests/gadget-zero/main-stm32f3-disco.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/tests/gadget-zero/main-stm32f3-disco.c b/tests/gadget-zero/main-stm32f3-disco.c index de5bfccf..4c8d3d09 100644 --- a/tests/gadget-zero/main-stm32f3-disco.c +++ b/tests/gadget-zero/main-stm32f3-disco.c @@ -39,28 +39,12 @@ do { } while (0) #endif -const struct rcc_clock_scale this_clock_config = { - /* 72MHZ from 8MHZ external clock from stlink MCO */ - .pllsrc = RCC_CFGR_PLLSRC_HSE_PREDIV, - .pllmul = RCC_CFGR_PLLMUL_MUL9, - .plldiv = RCC_CFGR2_PREDIV_NODIV, - .usbdiv1 = false, - .flash_waitstates = 2, - .hpre = RCC_CFGR_HPRE_DIV_NONE, - .ppre1 = RCC_CFGR_PPRE1_DIV_2, - .ppre2 = RCC_CFGR_PPRE2_DIV_NONE, - .ahb_frequency = 72e6, - .apb1_frequency = 32e6, - .apb2_frequency = 72e6, -}; - - int main(void) { rcc_periph_clock_enable(RCC_GPIOE); gpio_mode_setup(GPIOE, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO11|GPIO12); gpio_set(GPIOE, GPIO12); - rcc_clock_setup_pll(&this_clock_config); + rcc_clock_setup_pll(&rcc_hse8mhz_configs[RCC_CLOCK_HSE8_72MHZ]); rcc_periph_clock_enable(RCC_GPIOA); /*