/*!< Wait till HSI is ready */
while (RCC_GetFlagStatus(RCC_FLAG_HSIRDY) == RESET);
RCC_PLLCmd(DISABLE);
// set PLLMUX to 16*6, and PLL to 16*6/4
RCC_PLLConfig(RCC_PLLSource_HSI, RCC_PLLMul_6, RCC_PLLDiv_4);
/* PLL enable */
RCC_PLLCmd(ENABLE);
/* wait for PLL stable */
while(RESET == RCC_GetFlagStatus(RCC_FLAG_PLLRDY));
// set PLL as sysclk
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
// Wait for the sysclock to be confirmed as our clock source.
while( RCC_GetSYSCLKSource() != 0x0C );
// Enable USB
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USB, ENABLE);