From bfc73a6675dfcde3bf85ce99a7182991cab8ed40 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sat, 1 Aug 2015 13:44:52 -0700 Subject: [PATCH] Move update_peripheral_clocks Incorrect order of operations would hang execution if switching to IRC. --- firmware/application/clock_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/application/clock_manager.cpp b/firmware/application/clock_manager.cpp index c7323978f..e674b067b 100644 --- a/firmware/application/clock_manager.cpp +++ b/firmware/application/clock_manager.cpp @@ -382,14 +382,14 @@ void ClockManager::change_clock_configuration(const cgu::CLK_SEL clk_sel) { set_m4_clock_to_irc(); + update_peripheral_clocks(clk_sel); + if( clk_sel == cgu::CLK_SEL::PLL1 ) { set_m4_clock_to_pll1(); } else { power_down_pll1(); } - update_peripheral_clocks(clk_sel); - start_peripherals(clk_sel); if( clk_sel != cgu::CLK_SEL::XTAL ) {