CLK_HSEConfig(CLK_HSE_ON);
while(i--);
/* Wait for HIE mode oscillator ready */
while(!CLK_GetFlagStatus(CLK_FLAG_HSERDY));
/* Configures the system clock (SYSCLK) - HSE mode */
CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_HSE);
/* Configures the System clock (SYSCLK) dividers - CLK_SYSCLKDiv_1 */
CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1);
/* Enables or disables the clock switch execution */
/* If enabled, the clock switch to the source defined in thd CLK_SWR register. */
CLK_SYSCLKSourceSwitchCmd(ENABLE);