/* Initialization of I/O in Input Mode with Interrupt */
GPIO_Init(BUTTON_PORT, BUTTON_PIN, GPIO_MODE_IN_FL_IT);
/* Initialization of the Interrupt sensitivity */
EXTI_SetExtIntSensitivity(EXTI_PORT_GPIOC, EXTI_SENSITIVITY_FALL_ONLY);
/* Enable general interrupts */
enableInterrupts();
CLK_DeInit();
/* Configure the Fcpu to DIV1*/
CLK_SYSCLKConfig(CLK_PRESCALER_CPUDIV1);
/* Configure the HSI prescaler to the optimal value */
CLK_SYSCLKConfig(CLK_PRESCALER_HSIDIV1);
/* Output Fcpu on CLK_CCO pin */
CLK_CCOConfig(CLK_OUTPUT_CPU);
/* Initilize the CLock controller according to CLK_InitStructure */
status = CLK_ClockSwitchConfig(CLK_SWITCHMODE_AUTO, CLK_SOURCE_HSE, DISABLE, DISABLE);
while (ButtonPressed == FALSE);
status = CLK_ClockSwitchConfig(CLK_SWITCHMODE_AUTO, CLK_SOURCE_HSI, DISABLE, DISABLE);
while (1);
}
哪里有问题,下面是readme的
/** @page CLK_MaxSpeed Configuring clocks for maximum speed
@par Example description
This example provides two optimal clock configurations
- Fcpu running at 24Mhz (HSE)
- Fcpu running at 16Mhz (HSI)