求解答
void RCC_System_Config(uint32_t pllmul)
{
RCC_DeInit(); //1
RCC_HSEConfig( RCC_HSE_ON);//2
if(RCC_WaitForHSEStartUp() == SUCCESS)//3
{
RCC_HCLKConfig( RCC_SYSCLK_Div1);//4
RCC_PCLK2Config( RCC_HCLK_Div1);//5
RCC_PCLK1Config( RCC_HCLK_Div2);//6
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, pllmul); //7 // PLLʱÖÓ= HSEƵÂÊ;RCC_PLLMul_9 PLL x 9
RCC_PLLCmd(ENABLE); //8
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) {}//9
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK); //10
while(RCC_GetSYSCLKSource() != 0x08) {} //0x08LL ʱÖÓÔ´
}
else
{
while(1);
}
} |