Delay()函数,变量i定义为16位,i不可能达到0x003fffff这个值。for(i=0;i<0x003fffff;i++)是错误的 |
静态变量申明问题,前面的一个_I是什么?去掉试试 |
#ifndef __LED_H #define __LED_H #include"stm32f0xx.h" void LED_Init(void); #endif |
#include"stm32f0xx.h" #include"LED.h" void LED_Init(void) { GPIO_InitTypeDef GPIO_InitStruct; RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA,ENABLE); GPIO_InitStruct.GPIO_Pin=GPIO_Pin_3; GPIO_InitStruct.GPIO_Mode=GPIO_Mode_OUT; GPIO_InitStruct.GPIO_OType=GPIO_OType_PP; GPIO_InitStruct.GPIO_Speed=GPIO_Speed_Level_3; GPIO_Init(GPIOA,&GPIO_InitStruct); GPIO_SetBits(GPIOA,GPIO_Pin_3); } |
错误都调试过了 |