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/stm32f2/rcc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libmaple/stm32f2') diff --git a/libmaple/stm32f2/rcc.c b/libmaple/stm32f2/rcc.c index b94f2e6..46e6565 100644 --- a/libmaple/stm32f2/rcc.c +++ b/libmaple/stm32f2/rcc.c @@ -173,6 +173,9 @@ void rcc_configure_pll(rcc_pll_cfg *pll_cfg) { stm32f2_rcc_pll_data *data = pll_cfg->data; uint32 pllcfgr; + /* Check that the PLL is disabled. */ + ASSERT_FAULT(!rcc_is_clk_on(RCC_CLK_PLL)); + /* Sanity-check all the parameters */ ASSERT_FAULT((data->pllq >= 4) && (data->pllq <= 15)); ASSERT_FAULT((data->pllp >= 2) && (data->pllp <= 8)); -- cgit v1.2.3