初级会员

- 积分
- 71
- 金钱
- 71
- 注册时间
- 2019-8-17
- 在线时间
- 21 小时
|
#include"stm32f10x.h"
void delay{u32 count}
{u32 i=0;
for{;i<count;i++);
}
int main(void)
{GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|
RCC_APB2Periph_GPIOE,ENABLE);
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_initstructure.GPIO_Speed=GPIO_Speed_50MHZ;
GPIO_Init(GPIOB,&GPIO_InitStructure);
GPIO_SetBits(GPIOB,GPIO_Pin_5);
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_5;
GPIO_Init(GPIOE,&GPIO_InitStructure);
GPIO_Setbits(GPIOE,Gpio_Pin_5);
while(1)
{gpio_ReSetBits(GPIOB,GPIO_Pin_5);
GPIO_setbits(GPIOE,GPIO_Pin_5);
delay(3000000);
GPIO_setbits(GPIOB,GPIO_Pin_5);
GPIO_restbits(GPIOE,GPIO_Pin_5);
delay(3000000);
}}
Build target 'template'
compiling main.c...
main.c(2): error: #70: incomplete type is not allowed
void delay{u32 count}
main.c(2): error: #65: expected a ";"
void delay{u32 count}
main.c(24): warning: #12-D: parsing restarts here after previous syntax error
delay(3000000);
main.c(25): error: #169: expected a declaration
}}
main.c(29): warning: #1-D: last line of file ends without a newline
main.c(29): warning: At end of source: #12-D: parsing restarts here after previous syntax error
main.c: 3 warnings, 3 errors
compiling main.c...
main.c(2): error: #70: incomplete type is not allowed
void delay{u32 count}
main.c(2): error: #65: expected a ";"
void delay{u32 count}
main.c(24): warning: #12-D: parsing restarts here after previous syntax error
delay(3000000);
main.c(25): error: #169: expected a declaration
}}
main.c(29): warning: #1-D: last line of file ends without a newline
main.c(29): warning: At end of source: #12-D: parsing restarts here after previous syntax error
main.c: 3 warnings, 3 errors
"..\OBJ\template.axf" - 6 Error(s), 6 Warning(s).
Target not created.
Build Time Elapsed: 00:00:01
|
|