代码:
#include <stm32f10x_lib.h>
void Delay(void){
unsigned long ik;
for(ik=0;ik<0xffff8;ik++);
}
int main(void){
RCC_Configuration();
NVIC_Configuration();
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD,ENABLE);
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOD,&GPIO_InitStructure);
while(1){
GPIO_SetBits(GPIOD,GPIO_Pin_7);
Delay();
GPIO_ResetBits(GPIOD,GPIO_Pin_7);
Delay();
}
}
错误提示:
compiling led.c...
led.c(10): warning: #223-D: function "RCC_Configuration" declared implicitly
led.c(11): warning: #223-D: function "NVIC_Configuration" declared implicitly
led.c(13): error: #20: identifier "GPIO_InitStructure" is undefined
led.c(26): warning: #1-D: last line of file ends without a newline
led.c - 1 Error(s), 3 Warning(s).
#include <stm32f10x_lib.h>
void Delay(void){
unsigned long ik;
for(ik=0;ik<0xffff8;ik++);
}
int main(void){
RCC_Configuration();
NVIC_Configuration();
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD,ENABLE);
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOD,&GPIO_InitStructure);
while(1){
GPIO_SetBits(GPIOD,GPIO_Pin_7);
Delay();
GPIO_ResetBits(GPIOD,GPIO_Pin_7);
Delay();
}
}
错误提示:
compiling led.c...
led.c(10): warning: #223-D: function "RCC_Configuration" declared implicitly
led.c(11): warning: #223-D: function "NVIC_Configuration" declared implicitly
led.c(13): error: #20: identifier "GPIO_InitStructure" is undefined
led.c(26): warning: #1-D: last line of file ends without a newline
led.c - 1 Error(s), 3 Warning(s).