Move update_peripheral_clocks

Incorrect order of operations would hang execution if switching to IRC.
This commit is contained in:
Jared Boone 2015-08-01 13:44:52 -07:00
parent c025a2bba2
commit bfc73a6675

View File

@ -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 ) {