谢谢各位大侠,问题已解决。原因是我将核心板上的PC13当成了C13 |
#define LED_PORT GPIOC #define LED_PIN (GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_13|GPIO_Pin_15) #define LED_PORT_RCC RCC_APB2Periph_GPIOC |
GPIO_InitTypeDef GPIO_InitStructure; RCC_APB2PeriphClockCmd(LED_PORT_RCC,ENABLE); GPIO_InitStructure.GPIO_Pin=LED_PIN; GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz; GPIO_Init(LED_PORT,&GPIO_InitStructure); |