CLK_ICKR=0x08;
/* Configure clock prescaler */
CLK_CKDIVR = 0x01;
/*分频时钟源
*/
/* To select external source by automtic switch */
CLK_ICKR |= 0x10;
/* 使能转化 */
CLK_SWR
= 0xD2;
/* 时钟源选择 选择HSE*/
while (!(CLK_ICKR & 0x10));
/* 等待直到转换完成 */
if (CLK_CMSR != 0xD4)
检测是不是配置的时钟源
while(1); |