From 6632789976b804889494dc1e7aea51181d4ca754 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Mon, 26 Mar 2012 15:21:25 -0400 Subject: rcc_reconfigure_pll(): Assert that the PLL is disabled. Signed-off-by: Marti Bolivar --- libmaple/stm32f1/rcc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libmaple/stm32f1/rcc.c') diff --git a/libmaple/stm32f1/rcc.c b/libmaple/stm32f1/rcc.c index a9c9c3a..0752b82 100644 --- a/libmaple/stm32f1/rcc.c +++ b/libmaple/stm32f1/rcc.c @@ -139,6 +139,9 @@ void rcc_configure_pll(rcc_pll_cfg *pll_cfg) { rcc_pll_multiplier pll_mul = data->pll_mul; uint32 cfgr; + /* Check that the PLL is disabled. */ + ASSERT_FAULT(!rcc_is_clk_on(RCC_CLK_PLL)); + cfgr = RCC_BASE->CFGR; cfgr &= ~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLMUL); cfgr |= pll_cfg->pllsrc | pll_mul; -- cgit v1.2.3